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
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Jan 02, 2008 12:09 pm   

[2.18] Reformat script breaks working alias
 
Using Vijilante's priority queue script in the finished scripts section and tweaking it to use local variables etc...
The following alias
Code:
#ALIAS PQueueNewFlag {#LOCAL $PQueueCTemp1, $PQueueCTemp2, $PQueueCTemp3; $PQueueCTemp2=%replace(%prompt("","New flag short value?"),%char(34),"");#WHILE ($PQueueCTemp2) {#IF (%regex($PQueueCTemp2,"[\-\|\ =\.\?\;\[\]\,\:\(\)\'\{\}/]")) {$PQueueCTemp2=%replace(%prompt("","Previous entry invalid. New flag short value?"),%char(34),"")} {#IF (%ismember($PQueueCTemp2,%expanddb(@PQFlagDef,"|","|"))) {$PQueueCTemp2=%replace(%prompt("",%concat("'",$PQueueCTemp2,"' already used for '",%item(%expanddb(@PQFlagDef,"|","|"),%eval(%ismember($PQueueCTemp2,%expanddb(@PQFlagDef,"|","|"))-1)),"'. New flag short value?")),%char(34),"")} {#IF ($PQueueCTemp2!="") {$PQueueCTemp3=%concat($PQueueCTemp3,"|",$PQueueCTemp2);$PQueueCTemp2="";#WHILE ($PQueueCTemp2="") {$PQueueCTemp2=%replace(%prompt("",%concat("Description of flag '",%item($PQueueCTemp3,%numitems($PQueueCTemp3)),"'?")),%char(34),"");#WHILE (%regex($PQueueCTemp2,"[\-\|\=\.\?\;\[\]\,\:\(\)\'\{\}/]")) {$PQueueCTemp2=%replace(%prompt("",%concat("Description of flag '",%item($PQueueCTemp3,%numitems($PQueueCTemp3)),"'?")),%char(34),"")}};#ADDKEY PQFlagDef {$PQueueCTemp2} {%item($PQueueCTemp3,%numitems($PQueueCTemp3))}}}};$PQueueCTemp2=%replace(%prompt("","New flag short value?"),%char(34),"")}}


Works fine when pasted to the command line and compiles when you check it in the package editor. When you Ctrl-M to reformat it then it breaks with error
Quote:
Error compiling script:
illegal token: =%replace( %prompt( "", "New flag short value?"), %char( 34), "")


I'll try and trim it down a bit to find exactly which part isn't being reformatted correctly.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Jan 02, 2008 12:14 pm   
 
Phew, it was an easy one...

Code:
#ALIAS PQueueNewFlag {#LOCAL $PQueueCTemp2; $PQueueCTemp2=test}

Breaks when reformatted because of the space before $PQueueCTemp2=test on the second line.
(I removed the %replace stuff etc, because it wasn't relevant)
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jan 07, 2008 11:34 pm   
 
Added to bug list.
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