1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

calling a method

Discussion in 'Development' started by Masternoob, Feb 16, 2012.

  1. Masternoob

    Masternoob Member

    Is there a way that i can make a method available in my whole program?

    i wrote a test class with a method and i want to use it in my programm without having to do this before every call:
    Code (progress):
    1. definine variable xxx as class class.yyy no-undo.
    2. xxx = NEW class.yyy
    thx for your help
  3. KleineCuypie

    KleineCuypie New Member

    You can make a static method. Then you don't have to initiate the class and directly go to your method by using.
    Code (progress):
    2. class.yyy:yourMethod().
    5. CLASS class.yyy:
    8. METHOD PUBLIC STATIC VOID yourMethod():
    9. END METHOD.
  4. Masternoob

    Masternoob Member

    thank you!
  5. tamhas

    tamhas ProgressTalk.com Sponsor

    WARNING! Use statics with care. Once the class is referenced, it is in memory until the session is over. No way to remove it. There are many unpleasant side effects. Only make something static when you are really, really sure that is the right thing to do.

Share This Page