Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Ceres
Wanderer


Joined: 25 May 2006
Posts: 88

PostPosted: 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.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: 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 :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net