Page 1 of 1

modify global value from query return

Posted: Sun Sep 02, 2007 1:01 am
by reelstuff
I have a return value from a query.php file, which is basically,
return:true
or
return:false

I was thinking of how to make this a global so that I can call this global, from any card.

but I am a little lost on globals and the documentation, well I just cant seem to get what information is there.

So what I am working on is how to have a global that can change from false to true and back to false
should the code below return false at some point in the future.

So I guess my question is how to modify a global with the result of the query returned.

global myglobal {false|true}
depending on the current status of the field sData

Code: Select all


on mouseUp
   put "http://www.somewebserver/query.php?" into tUrl
   put "r=" into tString
   put FIELD "preceipt" after tString 
   put "&e=" after tString
   put FIELD "pemail" after tString 
   put "&k=" after tString
   put "1ABvuc58kljh" after tString
   post tString to url tUrl
   if the result is empty then
   put it into Field "sData"
   else
   put the result into FIELD "sData"
 end if
 put FIELD SData into it
 if it is "return:true" then go to next card
 else answer "Incorrect code please try again"
end mouseUp

Posted: Sun Sep 02, 2007 11:17 am
by Klaus
Hi reelstuff,

let me see if I get it... :-)

...
global myglobal
If fld "sDate" = "return:true" then
you want to put "true" into myglobal
else
you want to put "false" into myglobal
end if
...
?

If yes then you could adopt my suggestion almost 1:1 ;-)


You could also:
...
global myglobal
put (fld "sDate" contains "true") into myglobal
...

to get the necessary Boolean value :-)

Hope that helps.


Best from germany

Klaus

Posted: Sun Sep 02, 2007 1:05 pm
by reelstuff
Yes, thank you I believe I understand it a lot better now.