Pass a class to a variable

Post your Gambas programming questions here.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Pass a class to a variable

Post by BruceSteers »

I assume you have studied the wiki
http://gambaswiki.org/wiki/comp/gb/class
http://gambaswiki.org/wiki/comp/gb/classes

Things like

Class.Name
Object.Parent

Surely if your form manually loads a specific class it can make a note of the class name and store it somewhere that the other form can see?
If at first you don't succeed , try doing something differently.
BruceS
Ham13
Posts: 19
Joined: Friday 24th June 2022 2:11pm

Re: Pass a class to a variable

Post by Ham13 »

I tried a new tack. The object is to get a sequential list of data records so that the record's position in the list is equivalent to the record number. The class is the method used to generate this list. So why not make a collection from the list and pass the collection to the other form? In that way the list no longer needs the class to be used on the other form. After some tinkering with the code I got it working. Maybe unconventional but, it works for now.

I'm going to try Cedric's approach to sending the collection over using a function an see what I can do with that idea.

Regards,

Marty
Post Reply