[Gambas-user] Question on Class.Load

Ian ian.roper at ...1974...
Sun Nov 2 05:01:49 CET 2014


Class.Load allows you to create a reference to a named class.

Dim TempClass as Class
TmpClass = Class.Load("myclass")

This works and I can get the names of the public instances of variables 
and procedures

For each TmpString in TmpClass.Symbols
Message(TmpString)
Next

Is there a way to call a Procedure or Function from the named class and 
pass it any parameters that it requires?

ie: if I have a procedure in a valid class I have created called Public 
Sub DoSomething(InStr as string)
can I call this function from TmpClass somehow
(or is this just a 'read only' reference to the loaded class?)


I tried Object.Call(TmpClass, "NameOfProcedure", TmpAry)
with TmpAry[] containing the name of a single string parameter I wish to 
pass.
This returns the error: "Can't find {NameOfProcedure} in Class 'Class'

Context: In each of my projects created classes, I have a standard 
Procedure to save the applicable database table records to a binary file 
called CreateBinaryFile(InPath as String)
This is the process I am trying to call for each class that I have created.


Cheers,
Ian Roper.




More information about the User mailing list