> Greetings,
> 
> I have a handler that calls another handler. I can embed the 2nd handler in
> the first one, but I make it separate in case I can reuse it from another
> script. The problem is there are values, expressions that have to be saved
> as globals. Instead of letting the globals floating around when the program
> is running, is there a way to kill it after it's done. I don't know if
> properties would do it since I only know how to use it in a sprite situation.

Time for OOP... just the phrase "letting the globals floating around" is a
good indicator that what you really *want* to do is OOP. I'm not saying OOP
is better (god forbid we open that thread again), but in your case, I think
you should look into making an object that will store the information (and
methods) that you want in one convenient package. Lots of people on this
list can help you with the specifics - I'm sure Irv would love another
disciple. :)

If, when you say "I don't know if properties would do it since I only know
how to use it in a sprite situation", you mean that you understand how to
write behaviors, then you are only a short step away from writing a parent
script for a RAM-only object - it's almost the same thing. Imagine a
behavior that's not attached to a sprite - it does all of the things that a
behavior does, but is called to in a slightly different way.

This is not to say that you need to learn Lingo-OOP - as Kerry said, you can
do it by passing arguments. But it seems to me, from the wording of your
question, that your personal coding style is suited to it.

-Kurt


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to