Perm/global and native variables
Posted: 17 Feb 2013 12:42
Code: Select all
perm $a = "<xyscripts>"; echo "$a";Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
perm $a = "<xyscripts>"; echo "$a";I didn't only think of strings, but also functions like substr(), concatenations, etc.Marco wrote:I guess so. Trouble only shows up with native variables, other strings are fine.
Code: Select all
perm $a;
$a = "<xyscripts>"; echo "$a";Just try:FluxTorpedoe wrote:Hi there, been a while!![]()
I ran into this situation before, and it looks like when simultaneously declaring and assigning a variable, its value (e.g. native vars) isn't evaluated. So I guess in general we'd better declare perms and globals first, then assign them.
i.e.:I don't know if that was really the point of your question...Code: Select all
perm $a; $a = "<xyscripts>"; echo "$a";
...Trying to get back in XY saddle
Code: Select all
perm $a;
$a = "<xyscripts>"; echo "$a";
perm $b = "<xyscripts>"; echo "$b";Code: Select all
perm $a, $b;
$a = "<xyscripts>"; echo "$a";
$b = "<xyscripts>"; echo "$b";Yes, no, ahhh...FluxTorpedoe wrote:Hmm, then I clearly misunderstood your question, sorry. I still don't know what you're pointing at, since in your last example you're again simultaneously declaring and assigning $b, instead of declaring it first.But maybe that's what you were stressing out since it's working with regular values... well, I guess I should get some sleep.Code: Select all
perm $a, $b; $a = "<xyscripts>"; echo "$a"; $b = "<xyscripts>"; echo "$b";
Confirmed. Should work as expected next time.Marco wrote:shows literally <xyscripts> instead of the resolved path. Even on fresh install.Code: Select all
perm $a = "<xyscripts>"; echo "$a";
Yep, I'm playing with the (really) new stuff. So 0014 broke something?PeterH wrote:Yes, no, ahhh...![]()
It's so: implicit assigning a value while defining is quite new implemented by Don - and Marco want's to use that, I think.
(And in the next days I'll use that, too...)
In between the time we found out that this implicit assignment worked wit 12.10.0013, but refused to work with 0014 - so we had some problems to synchronize our findings and see the root of the problem
Yeah there are a couple of new neat toysFluxTorpedoe wrote:Ohhh okay, I really missed some wagons there!![]()
And I also have to head into these new toys of "_Initialize" & Co... So I'll leave you to do the spadework while I'll get back to my homework!