Semicolon
Monkey Forums/Monkey Programming/Semicolon
| ||
In "BlitzMax" is Semicolon that allows you to write two "IF" on one line. There is, whether something similar realties in Monkey ?if a>0 ; if a=2 then a=0 ' or just a=10 ; b=12 ; c=23 |
| ||
Simply use spaces:local a=10 local b=12 local c=23 |
| ||
What about:If a>0 And a=2 then a = 0 Simply use spaces AFAIK this works becouse of the way the internal Monkey tokenizer and parser works, but this is not officially supported. Officially, if I'm not wrong, several sentences in the same line is not allowed in Monkey. So while it works sometimes, this could change in the future. |
| ||
Semicolons helped with readability, especially when writing for 99 line ray-tracing competitions. |
| ||
I wouldn't mind if it just ignored the semi colon, coming from a C/C++ background it's second nature to end a line with a ; now. |
| ||
I kinda wish we had this. I unconsciously put a semicolon after each line. Now trying to train myself not to do this when coding in monkey :). |
| ||
mmm, why? Semicolons where added several Monkey versions ago, they're just optional now.Function Main(); Local a:String = "Hello World!";Print(a); End |
| ||
Lol, goes to show you how behind i am. Thanks ziggy, I feel much better now :). |