Code: Select all
"_Initialize"
global $a=1;
"Show"
msg $a;
"Test"
msg $a;
"_Terminate"
msg Bye;Code: Select all
"_Initialize"
global $a=1;
"Show"
msg $a;
"Test"
msg $a;
"_Terminate"
msg Bye;I didn't see that written anywhere, time for glasses?PeterH wrote:I'm afraid this only works for perm?
Code: Select all
"_Initialize"
global $a=1;
"Show"
global $a;
msg $a;
"Test"
global $a;
msg $a;
"_Terminate"
msg Bye;And with fresh 12.10.0014?PeterH wrote:![]()
Just tried it with "Try Script..."works as I'd expect!
For both routines "1" is displayed![]()
(I'm using 12.10.0013 in the moment.)
It's the question what you want to achieve, I think.klownboy wrote:Same here, though I tried the same (Marco) script with perm and it worked fine with v12.10.0014 (i.e., I received "1" and then "bye"). At least initially, I'm not sure it was Don's intention for it to work with global, he seemed to be concentrating on "perm" based on this thread http://www.xyplorer.com/xyfc/viewtopic.php?f=5&t=9224 Even in the beta description, Don refers to "perm" when referring to "_Initialize" and "_Terminate". Though I'm not sure why it wouldn't or shouldn't work with global.
Ken
Exactly.PeterH wrote:So if I define a global in scripts like "_Initialize", "_somename" or "Main" it should function alike. And the same is for assigning values.
From my POV _Initialize is nothing but a script that's automatically executed before label-selection is shown.
Yes, but "_Initialize" is so much more than that since it is auto-recognized in any MSR file, it is executed first in any situation. It opens up additional possibilities as in other programs like AHK. Yes, I think it's a good thing that Don was able to make an XY variable like environmental variables display in a menu. The new scripts "_Initialize" and "_Terminate" should not be directly related to use of Perms. I'm not sure if he had coding reasons why he choose Perm in lieu of Globals as far as menu display.From my POV _Initialize is nothing but a script that's automatically executed before label-selection is shown.
Code: Select all
"_Initialize"
global $a = "Bye!";
"Show 1"
global $a;
msg $a;
"Show 2"
global $a;
msg $a;
"_Terminate"
global $a;
msg $a;