Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Label need not be declared?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue Apr 26, 2016 8:43 pm    Post subject: Label need not be declared? Reply with quote

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?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Tue Apr 26, 2016 9:13 pm    Post subject: Reply with quote

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

Regardless of that:
http://forum.cheatengine.org/viewtopic.php?p=5647327#5647327

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.
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue Apr 26, 2016 10:17 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites