[Gambas-devel] How to pass objects and access their properties

Randall Morgan rmorgan62 at ...176...
Thu Feb 2 22:48:08 CET 2012


Hi Benoit,

I have a skeleton Complex class now but I am having difficulty locating any
sample code that shows how to pass an object in to a method and access it's
properties.

The reason I want to do this is that complex numbers have a real and
imaginary component. libgsl defines these as a structure containing two
doubles. So my class
contains two properties real, and imag. Rather than having the user write
something like:

Q.Add(V.real, V.imag)

I would prefer the user be able to simply pass in the complex object and
let the underlying code access the properties of the object.

So can you point me to some sample code where I can see how this might be
done?

Thanks,

Randall


-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20120202/648a5946/attachment.html>


More information about the Devel mailing list