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
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Wed Aug 29, 2007 10:18 pm   

[2.01] parsing error
 
Code:
#ALIAS do_something {say hi}


suppose inside a trigger you have:

Code:
#IF (@balance) {
  #SAY I have balance
do_something
}


the output will be:
I have balance do_something

Code:
#IF (@balance) {
  #SAY I have balance
  do_something
}


echos I have balance
and performs say hi as expected.
Reply with quote
Tech
GURU


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

PostPosted: Thu Aug 30, 2007 4:54 am   
 
I don't think that's a parsing error. I think it has to do with the stricter rules about indenting. But my brains been fried for a few days so I'm sure someone will correct me. Very Happy
_________________
Asati di tempari!
Reply with quote
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Thu Aug 30, 2007 6:30 am   
 
It's hard to imagine that a hard return wouldnt be as effective as a hard return plus 2 spaces.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Aug 30, 2007 12:28 pm   
 
It's been discussed and documented, however. Tech is right, and your problem is caused by your lack of indentation. CMUD assumes that the non-indented line is a continuation of the previous line. It's a feature, though I can see how it can cause some confusion.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Aug 30, 2007 5:42 pm   
 
Yep, Tech is correct. CMUD is *very* picky about proper indentation with multi-line scripts. Sort of like Python in this regard. That's why CMUD has the Reformat Script option in the Editor menu (Ctrl-M)

Think of it this way...it's good practice to learn that whitespace *does* matter in some programming languages.
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