|
Ceres Wanderer
Joined: 25 May 2006 Posts: 88
|
Posted: Sun Oct 22, 2006 4:12 pm
[1.11] Local variables and commands |
Whilst converting some zscrips to make use of local variables I may have come across an issue, following is an example entered from the command line:
Code: |
testvar={test|two|three|test|two|three};#echo @testvar;#DELITEM testvar two;#echo @testvar
Output is as expected:
test|two|three|test|two|three
test|three|test|three |
Converting it to use local variables from the command line:
Code: |
$testvar={test|two|three|test|two|three};#echo $testvar;#DELITEM $testvar two;#echo $testvar
Output is not as expected:
test|two|three|test|two|three
test|two|three|test|two|three |
Without this functionality it would be necessary (in the case of #DELITEM) to assign the value of the temp variable to a regular variable before executing the command and assigning it back into a temp variable if further operations are required on the value (it is in many places of my code).
For local variables to be used to the greatest possible advantage all commands and functions need to be able to make use of them otherwise scripting becomes even more complicated. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Sun Oct 22, 2006 9:08 pm |
This has already been mentioned a couple of times. Currently most commands and functions have not been updated to handle local variables. For now assume that only #VAR has.
|
|
_________________ Taz :) |
|
|
|
|
|