|
Dark Byte Site Admin Reputation: 458 Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Thu Jul 08, 2010 7:02 pm Post subject: |
|
|
labels and allocs are only valid in the script they are in. More specifically, in the [enable] [disable] (or both)
So you can safely run two scripts with the same labels
As for using the template twice in the same script, ce will deal with this for you (it adds a number after the label names)
To use a label outside the scope of the current script, you must use the "registersymbol" command so that other scripts (and the rest of ce, like tables) can understand what you mean with the specific label name
As for alloc there is a special variant for this:
GlobalAlloc(name,size)
If you use GlobalAlloc it will be registered as a symbol so it's usable by the rest of CE, AND any new call to GlobalAlloc won't allocate the memory again but just gives the already allocated block(But make sure the sizes you give in all scripts are the same, a re-alloc because the size is bigger means that some of the old data will be gone)
---
Of course, most likely you'll be fine with the normal alloc in enable and dealloc in disable, there's usually not that much need for multiple scripts to allocate the same block of memory. Only useful when some scripts need to make use of the same allocated memory, and you're not sure which one will get executed first by the user _________________ Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
|
|
Back to top |
|
|
Post reviews: 3 |
|
|
Author |
Review |
Review: Post reference: |
Posted: Wed Jul 14, 2010 8:24 pm |
|
|
One of a billion examples of DB kindly taking the time to share his wisdom. Thank you, DB!
|
|
Back to top |
|
|
Review: Post reference: |
Posted: Sun Nov 07, 2010 11:42 am |
|
|
Vuile slet.
|
|
Back to top |
|
|
Review: Post reference: |
Posted: Thu Mar 11, 2021 2:19 am |
|
|
Thanks..
|
|
Back to top |
|
|
|