|
Anrok Apprentice
Joined: 19 Nov 2010 Posts: 119
|
Posted: Thu Jan 06, 2011 1:16 am
#read and %1 expansion |
Taken from the help file:
Quote: |
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 |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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:
Called by
Code: |
#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.
Called by
Code: |
$temp = "Zugg"
#read 1 5
#close 1 |
@temp - normal variable references seem to work.
Called by
Code: |
temp = "Zugg"
#read 1 5
#close 1 |
|
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
|
|