[Gambas-user] structure and class

Gianluigi gradobag at gradobag.it
Wed Aug 9 08:03:44 CEST 2023


Il 08/08/23 23:28, T Lee Davidson ha scritto:
> On 8/8/23 12:53, Marco Ancillotti wrote:
>> Now , I've made a class that is like:
>>
>> Public column1 as integer
>> Public column2 as string
>> Public column3 as Float
>> Public column4 as blablabla
>>
>> I then made an array of that class and push my query result data to 
>> that array.
>>
>> It work but it need a lot of code so I would like to dynamic declare 
>> the class looking columns in results so I can
>> made a reusable function with different query.
>>
>> Thanks
>> Marco.
>
> I still don't understand why you are complicating things by trying to 
> use a class. Could something like the following suit your needs?
> ...


Hi Lee,

I don't think he can query the database with Gambas, he has to pass the 
result to a class probably to display it in a grid.
If so, the answer can be found in this example on the farm 
ResultByTwoDatabases which uses a class created directly by Benoit. See 
this thread: 
https://lists.gambas-basic.org/pipermail/user/2022-December/077816.html

Regards
Gianluigi




More information about the User mailing list