Menu

Significant length for variables and labels

2018-10-18
2018-10-18
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-10-18

    Hello ...

    How many characters are significant in variable names and labels ? I wondered why I didn't get an error message when I used a label "Debut_manuel:" and a "GoTo Debut_man" (which in fact didn' exist).

    Thanks for any answer.

     
  • stan cartwright

    stan cartwright - 2018-10-18

    This assembles ok. Does it work though? Seems you can goto a variable..calculated gotos, naughty.. but nice? Gosub works to.

    1   #chip mega328p,16
    2   #option explicit
    3   dim label as byte:label=10
    4   goto label ; could be gosub label
    5   ;
    6   ;
    7   ;
    8   ;
    9   ;
    10  goto 4 ; return... if gosub used
    
     

    Last edit: stan cartwright 2018-10-18
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-10-18

    Seems that GCB is not "strict" enough, this is an open door for Murphy's law ! So I searched for all "Goto's" in my source text (8 among 500 lines) and verified that the labels were OK. Despite of the fact that in the eyes of some programmers such jumps are not "politically correct" they cannot be always avoided ...

     

    Last edit: Bertrand BAROTH 2018-10-18

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.