$O10-Mac : Called function returns kTrue but calling function see it as empty

jmv jmvoegeli at bluewin.ch
Sat May 23 04:26:15 EDT 2020


Hi Doug, Hi Stefan, Hi John,

Thank you for your times.

here is the call :

Do method $cinst.$Datum (vMsg,vImgDir,vDate,vPériode,pVoir_Les_mois,vDate_De,vDate_A) Returns vValide

If (not(vValide))
Calculate vDate_De as ""
Calculate vDate_A as ""
Calculate vPériode as 255
End If

$Datum is inherited from another library. It ends with :
Quit method vValide

There vValide is set to kTrue. But the return value is set to "empty"


I commented/uncommented the code.

I try to put kTrue in place of vValide : "Quit method vValide" -> "Quit method kTrue"


> Guess: My thought was that during the processing of the IF statement, they
> (Omnis) may process window events, which may affect something that doesn't
> let the flag return properly. Maybe another window handling the totop event,
> but I haven't been able put any time into figuring it out in more detail.

The method $Datum call an object that open a window to choose two dates (from & to).
After the user clic OK, the method get the choices and verify if it is acceptable.

Those methods are in an other library that contains such paraphernalia common to others libraries.


BUT :

If I put the return value in an instance variable, like 

Do method $cinst.$Datum (vMsg,vImgDir,vDate,vPériode,pVoir_Les_mois,vDate_De,vDate_A) Returns iValide

then

If (not(iValide))                 ## Correct value
Calculate vDate_De as ""
Calculate vDate_A as ""
Calculate vPériode as 255
End If

(The instance variable is inherited.)

It is a work around but does not explain why the value of the boolean is lost between the end of a method and the beginning of the following.

Thank you for your answers.

Take care.

Jean-Marc









More information about the omnisdev-en mailing list