 |
gmueller Apprentice
Joined: 06 Apr 2004 Posts: 173
|
Posted: 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. |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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. 
|
|
_________________ Asati di tempari! |
|
|
 |
gmueller Apprentice
Joined: 06 Apr 2004 Posts: 173
|
Posted: 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.
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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.
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
 |
|
|