Page 1 of 1
Dancing with labels...
Posted: Thu Apr 01, 2010 6:47 pm
by Melissa
Just got bored once again:
Code: Select all
*Label : Goto *Label
; Syntax error
...However...
Code: Select all
*Label : *Label :
; Error: duplicate label.
Not too disturbing, indeed, but still need more love.
Re: Dancing with labels...
Posted: Mon Apr 05, 2010 9:25 am
by UserOfPure
You can report a bug for anything if you mess up the names with invalid characters. What do I mean? Well, the manual (which you read?) says that labels can't contain operators, yet you used * in the label name. Remove the * like the manual says and both examples are fine, in that the first loops endlessly and the second reports a duplicate label.
In other words, what you've done is the equivalent of reporting this as a bug, because it too gives a syntax error:
Code: Select all
*CreateImage(1,640,480) ; Syntax error.
Re: Dancing with labels...
Posted: Mon Apr 05, 2010 11:46 am
by Melissa
Well, you are right - it's seems to be just a limitation of parser. So, there are some solution:
Re: Dancing with labels...
Posted: Mon Apr 05, 2010 12:19 pm
by Kuron
Melissa wrote:Not too disturbing, indeed, but still need more love.

Re: Dancing with labels...
Posted: Mon Apr 05, 2010 8:35 pm
by fsw
Melissa wrote:Well, you are right - it's seems to be just a limitation of parser. So, there are some solution:
The Help file states:
Labels
All labels must be followed by a : (colon). Label names may not contain any operators (+,-,...) as well special characters (ß,ä,ö,ü,...).
You don't have to put the operator * in front of the label name, and it's not a pointer either...
Besides it's good practice to do:
(no space between the label name and the colon) instead of:
because colon can be used to concatenate commands like:
If IsCrazy = 0 : MessageRequester("Info", "Not Crazy") : Else : MessageRequester("Info", "Crazy") : EndIf
Hope to have cleared some things up.
Take care
fsw
BTW: the last example is straight from the help file. The words used in the example don't imply a connection to a person reading it...
...I hope. If somebody needs further clarification on this please contact the original writer of the help file. Thanks.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 7:05 am
by Melissa
OK, some more tests:
...Looks like that parser just unable to distinguish label from pointer on definition stage. Well, since I already found such usage in some polyglot code – may be a feature as well.
Besides it's good practice to do:
Just testing, really.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 7:57 am
by Rings
moved....
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 9:00 am
by Melissa
Well, since Ring officially stated here that ability to define *–powered labels is actually a feature, may be some correction in documentation (“Label names may not contain any operators”) should be made ^^ ?
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 10:59 am
by UserOfPure
Rings isn't a team member. He's just a forum mod. (No offense intended, Rings). The docs are correct until the team says otherwise.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 11:41 am
by Rings
The docs are clear for me,
such syntax is not allowed in PB (neither in classic VB )
so its not a bug,
That is why i moved that topic.
And this is not a statement.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 1:43 pm
by Melissa
UserOfPure wrote: Rings isn't a team member. He's just a forum mod.
It was kind of sarcasm). Well, now we just should decide what
is wrong here:
Code: Select all
*Label : Goto Label ; No errors generated !
...or...
Official manual wrote:Label names may not contain any operators
...’cause there are obvious conflict here. May be some poll would help ^^ ?
Rings wrote:such syntax is not allowed in PB (neither in classic VB )
It
is allowed (partially). Just look above.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 2:16 pm
by UserOfPure
If it works, it's just a fluke. Just obey what the docs say and be done with it. Don't use the *. Easy.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 2:19 pm
by Melissa
If it works, it's just a fluke.
Then, if it isn't intended behavior, thread should be moved back to "Bug Reports", right ?
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 2:22 pm
by UserOfPure
No, because it's not a bug if you don't do what the manual says. And I feel like I'm feeding the troll here.
Re: Dancing with labels...
Posted: Tue Apr 06, 2010 2:25 pm
by Melissa
No, because it's not a bug if you don't do what the manual says
So, isn't a bug when compiler doesn't do required checks for enforcing syntax rules ? I'm out of words here.
And I feel like I'm feeding the troll here.
Honestly ? Me too.