Page 1 of 1

[Request] Label Syntax Improvement

Posted: 22 Apr 2014, 18:23
by steeffeen
Hey there,

I would like to see it being possible to write the following syntax

Code: Select all

***LabelName***
***{
declare Player <=> Players[0];
}***
unfortunately this will cause a syntax error (unexpected curly bracket)

why do i want this?
the declared variables in labels stay alive/available
this might cause problems on naming but also unnecessary memory usage (working in an extra block fixes this)
so i like to wrap my own labels which don't need to be able to create permanent variables in curly brackets

Code: Select all

{+++LabelName+++}
but that's not possible if you use labels of base scripts like the ModeBase

an additional solution would be adding another syntax used instead of "***" which realises such method-like implementation, like using another character -> "°°°"
but i can't imagine a good one right now :)

(a work-around is to add a trivial command before the opening bracket, for example the following:

Code: Select all

***LabelName***
***while(False)break;{
declare Player <=> Players[0];
}***
i think i don't have to mention that this sucks :P
an empty statement would be helpful for this, too ^.^)

regards

Re: [Request] Label Syntax Improvement

Posted: 24 Apr 2014, 09:40
by Akbalder
In some scripts made by Nadeo, there is the instruction if(True){} to create a context.

Re: [Request] Label Syntax Improvement

Posted: 24 Apr 2014, 12:06
by steeffeen
ah yeah that's indeed a shorter work-around :thumbsup: