Posted: Tue Apr 26, 2016 8:43 pm Post subject: Label need not be declared?
If a label is not going to be registered as a symbol and is just used for jumping around in the code, CE doesn't give an error when saving the script. Is this a bug or feature? Are there any repercussions for not declaring such labels at the top, except for being messy and writing hard to maintain code?
First of all, declaring a label and registering it as a symbol are two different things.
Code:
label(foo) -- foo is now defined in the scope of this section of this script
registersymbol(foo) -- foo is now defined globally and can be referenced anywhere in CE
It's a feature that's annoying for some people but helpful for others. Personally, I don't use it in order to avoid any potential ambiguity (e.g. is this an undeclared label or a symbol registered somewhere else). _________________
I don't know where I'm going, but I'll figure it out when I get there.
Thanks. A double edged sword there. Could save one the trouble of maintaining a label section in front, yet make it harder for one to find errors if one were to maintain one.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum