Globals from the message box
Bob Sneidar
bobs at twft.com
Mon Nov 28 15:07:57 EST 2011
Hi all.
I seem to remember this working once, but it does not work now. In the message box I put:
global gLogonSite,gSiteID;put gLogonSite & "," & gSiteID
I get true. I should be getting something like 0,00002. Are semicolons legal in the message box or no? I know I can use the multiline section of the message box but often it is more convenient to use the semicolons. For instance, this works:
put "test1" into myArray[1];put "test2" into myarray[2];put myArray[1] & "," & myarray[2]
I get "test1,test2" but if I make the array a global and declare it before my put statement, I get true when I try to put any of the elements in the message.
But apparently you put globals into the message like this. Globals in the single line message box always seem to return true. What is perhaps some indicator of where things go wrong is the fact that I can modify the global variable in a single line message like so:
global myArray;put "test3" into myArray[1];put "test4" into myarray[2]
Then I can display the elements of the array in the multi-line message box like this:
global myArray
put myArray[1] & "," & myArray[2]
That works famously! It's only in the single line message box that semicolon delimited put statements using globals always resolves to true. Sounds buggy to me! Again, not a big bug, but I *AM* the Bugmeister!
Bob
More information about the use-livecode
mailing list