April 19, 2024, 09:07:47 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Simple Class Questions

Started by definitelyokay, August 25, 2009, 08:42:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

definitelyokay

Been using Emergence BASIC, and I like it a lot. ;D

However, I've run into a couple of questions with the OOP side of it.

Can you have a constructor that takes parameters? If so, how do you go about it that with the NEW command?

Is it like "Def X As New(xObject(param1, param2), 1)"?

And, how do you call a sub in a class from another sub in the same class. Do I need to use Object::SubName as usual?

I've been really studying the help file, but I seem to have gotten stuck on OOP up at this point.

Any help would be great! Thanks,

Joseph

LarryMc

QuoteAnd, how do you call a sub in a class from another sub in the same class. Do I need to use Object::SubName as usual?

No, you can just use the sub name by itself.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

definitelyokay

Thanks Larry! ;D

I guess you can't have a constructor with parameters, doesn't seem to work. So I just made another method...

LarryMc

The way I think of constuctors/destructors, right or wrong, is the places where I initialize all my member variables and then cleanup memory when I'm through.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library