• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 23. OBJECT-ORIENTED PROGRAMMING > CREATING AN OBJECT IN LINGO

CREATING AN OBJECT IN LINGO

To create an object, you must first create a parent script. As mentioned in the previous section, a parent script defines the methods and properties of objects created from it. The programming problem you are trying to solve determines the handlers and properties that you should include in your parent script. The basic method required by all parent scripts is the on new handler.

The on new handler creates a new object from a parent script. A parent script is like a template document in a word processing program. Just as you can create any number of identical documents from one template, you can create any number of identical objects by calling the new method of a parent script. Each time you send a parent script a new message, it creates a new object from that parent script.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint