TOPIC: Class - basics
#233
Class - basics 4 Years, 3 Months ago
Hello,

I want to try to make a function that would implement the Table_defenitions I have suggested in another post. I do not have much knowledge of how classes ar handled, hence i need help. The first thing i want to know is how I will come to know about the value of the any member of the table defition?
Defining Table_trial as
Code:


class
{
Keys: #('trial_3')
Columns:#('trial_1', 'trial_2')
Indices: false
}



and using Table_trial.GetDefault(Indices, false) is not helping.

When should I Construct a class? What is difference between using Construct, Class and new?

Thanks in advance,
ajith
 
 
#235
Re:Class - basics 4 Years, 3 Months ago
Hi Ajith,

In your example, you need to pass "Indices" as a string to GetDefault because it is expecting the name of a member. If you do not put quotes around it, Suneido will look for a global definition called Indices.

You will need to create an instance of your class only if there is class data (members) that will be changing each time the class is used. Otherwise you can just call the class methods directly on the class without creating an instance of it. I would recommend reviewing the Language > Classes section of the user's manual. It will clarify a few things for you, and explains how to make an instance of a class if necessary.
 
 
Jeff Ferguson
Suneido Software
 
#236
Re:Class - basics 4 Years, 3 Months ago
Hi,
Thanks for the information,
ajith