Page 1 of 1

Perm/global and native variables

Posted: 17 Feb 2013 12:42
by Marco

Code: Select all

perm $a = "<xyscripts>"; echo "$a";
shows literally <xyscripts> instead of the resolved path. Even on fresh install.

Re: Perm/global and native variables

Posted: 17 Feb 2013 12:57
by PeterH
Didn't test till now, so just to say: I'd expect that in this statement you can specify anything you could specify behind a "=" elsewhere?

Re: Perm/global and native variables

Posted: 17 Feb 2013 12:59
by Marco
I guess so. Trouble only shows up with native variables, other strings are fine.

Re: Perm/global and native variables

Posted: 17 Feb 2013 13:04
by PeterH
Marco wrote:I guess so. Trouble only shows up with native variables, other strings are fine.
I didn't only think of strings, but also functions like substr(), concatenations, etc.

Re: Perm/global and native variables

Posted: 17 Feb 2013 13:07
by Marco
Ah ok, got it now. Well... I still think so.

Re: Perm/global and native variables

Posted: 17 Feb 2013 13:24
by FluxTorpedoe
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.:

Code: Select all

perm $a;
  $a = "<xyscripts>"; echo "$a";
I don't know if that was really the point of your question...
...Trying to get back in XY saddle 8)

Re: Perm/global and native variables

Posted: 17 Feb 2013 13:41
by PeterH
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.:

Code: Select all

perm $a;
  $a = "<xyscripts>"; echo "$a";
I don't know if that was really the point of your question...
...Trying to get back in XY saddle 8)
Just try:

Code: Select all

 perm $a;
  $a = "<xyscripts>"; echo "$a";

 perm $b = "<xyscripts>"; echo "$b";

Re: Perm/global and native variables

Posted: 17 Feb 2013 14:24
by FluxTorpedoe
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.

Code: Select all

 perm $a, $b;
  $a = "<xyscripts>"; echo "$a";
  $b = "<xyscripts>"; echo "$b";
But maybe that's what you were stressing out since it's working with regular values... well, I guess I should get some sleep. ;)

Re: Perm/global and native variables

Posted: 17 Feb 2013 14:30
by PeterH
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.

Code: Select all

 perm $a, $b;
  $a = "<xyscripts>"; echo "$a";
  $b = "<xyscripts>"; echo "$b";
But maybe that's what you were stressing out since it's working with regular values... well, I guess I should get some sleep. ;)
Yes, no, ahhh... :roll:

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 :biggrin:

Re: Perm/global and native variables

Posted: 17 Feb 2013 14:51
by FluxTorpedoe
Ohhh okay, I really missed some wagons there! :wink:
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! ;)

Re: Perm/global and native variables

Posted: 17 Feb 2013 15:44
by admin
Marco wrote:

Code: Select all

perm $a = "<xyscripts>"; echo "$a";
shows literally <xyscripts> instead of the resolved path. Even on fresh install.
Confirmed. Should work as expected next time.

Re: Perm/global and native variables

Posted: 17 Feb 2013 17:01
by Marco
PeterH wrote:Yes, no, ahhh... :roll:

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 :biggrin:
Yep, I'm playing with the (really) new stuff. So 0014 broke something?
FluxTorpedoe wrote:Ohhh okay, I really missed some wagons there! :wink:
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! ;)
Yeah there are a couple of new neat toys :D

Thanks Don for fixing it.