| 02-19-2007, 08:44 AM | #1 |
JASS:function ReturnDamage takes integer i returns real if i==1 then return 185.0 elseif i==2 then return 340.0 else return 630.0 endif endfunction I tryed to do that, but in WE, it gave me : -Waiting for end line (line 2) -Waiting for endif (line 3) -Waiting for endif (line 4) -Type incorrect for the mentioned indicator (line 7, that line doesn't exist, there's no space in) Is that normal? |
| 02-19-2007, 08:48 AM | #2 |
Stuff needs to be on a new line after the end of then or of a function. This isn't C. |
| 02-19-2007, 09:43 AM | #3 | |
Quote:
JASS:function ReturnDamage takes integer i returns real if i==1 then return 185.0 elseif i==2 then return 340.0 else return 630.0 endif endfunction |
| 02-19-2007, 03:03 PM | #4 |
lol... Whitespace counts in JASS! |
| 02-19-2007, 09:21 PM | #5 |
Not whitespace, but newline. Each statement must be on it's own line. |
| 02-19-2007, 09:36 PM | #6 |
this could be solved by a statement delimiter, like ; !!!!!!!! |
