Table class receiving scope from windows
Table classes are excellent to encapsulate the code from the window. You would build public method (those with a $-sign as a prefix) or use the inbuilt methods such as $insert etc.
Then you define your row variable as an instance variable within your window or remote form. Let’s say it is called iDataRow. You can either use the subtype of the row point to your table class or you can use the command:
For row variables I recommend the subtype.
The row will then use the schema definition that is bound to the table class and you can access your data using iDataRow.columnname. So primarily the dataname of the fields would use this notation (nameOfTheRow.columnName).
If you then need to call a method within your table class – you actually don’t you call a method within your iDataRow:
Or whatever your method name is.
Inside the table class methods you would replace the name of the row using $cinst instead since the class does not has a clue what the instance name is gonna be. There you would use $cinst.columnname etc.
So all you need basically is that one row variable within your window or remote form.
Does that help?
> Am 29.01.2018 um 21:27 schrieb Das Goravani <firstname.lastname@example.org>:
> I want to use Table Classes, but I’m wondering, if you put code in one for a Save method say from a Window, the $cinst has changed, so all your instance variables in the Window are not available correct ? Isn’t that a problem ? To me it is. Please tell me if I’m right or if it works some other way, and if it is how I think, how do you get around it, I mean don’t you MISS the variables in the window, including the MAIN ROW ?
> As an aside, what are TM Objects ? What does that stand for I mean, Doug mentioned them, and I’ve never heard of them.
> Manage your list subscriptions at lists.omnis-dev.com
> Start a new message -> mailto:email@example.com