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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion

Joined: 19 Nov 2010
Posts: 119

PostPosted: Thu Jan 06, 2011 1:16 am   

#read and %1 expansion
Taken from the help file:

READ examples

#REA mud.txt
Read the file mud.txt line by line and execute each line as if you had typed it manually.

#FILE 1 mudlist.txt
#READ 1 10
read the 10th line from the file mudlist.txt

If the 10th line in the file is "kill %1" then
#READ 1 10 "zugg"
will execute the "kill zugg" command.

Did it the exactly same way and my CMUD returns kill 1, instead of kill zugg
Reply with quote

Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Jan 25, 2011 3:12 pm   
Confirmed bug. I tested with 3.33a.

There seems to be something wrong with how the parsing routine handles special characters.

%1 - references don't process properly and abort prematurely. Consider this line 5:

kill %1 %2 %3

Called by
#file 1 example.txt
#read 1
temp = "Zugg"
#read 1 5 "Zugg" "cat" "cow"
#close 1

$temp - local variable references prevent the line from being read at all.
kill $temp

Called by
$temp = "Zugg"
#read 1 5
#close 1

@temp - normal variable references seem to work.
kill @temp

Called by
temp = "Zugg"
#read 1 5
#close 1
Asati di tempari!
Reply with quote

Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Wed Jan 26, 2011 6:11 pm   
Yep, confirmed. I don't think this has ever worked in any version of CMUD. This was a feature that zMUD had, but since CMUD went to compiled scripts, the #READ command isn't able to handle the %nn expansion.

There isn't any way that Local variables will ever work with this though. But I'll add support for the %n arguments to the wish-list for a future version. Till then I might just change the help file.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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