Real Software Forums
http://forums.realsoftware.com/

REALArray element type
http://forums.realsoftware.com/viewtopic.php?f=5&t=44013
Page 1 of 1

Author:  mistiko [ Tue May 15, 2012 4:07 am ]
Post subject:  REALArray element type

Hi everyone,

I'm developing my first plugin and I need some suggestions on how to detect elements type within a realbasic array. More precisely the class in my plugin need a method like this one

Constructor(vect() as Variant)

which will be called in the following ways:

1) Dim myClass as new PluginClass(array(1,2,3,4))
2) Dim myClass as new PluginClass(array(1.0, 2.0, 3.0, 4.0))

Within the c++ plugin code how can I determine that in the first case array elements are integers while in case two are float?
I think that being a Variant array, elements type should be REALObject and from this I can inspect the "Type" property within the variant object. Is that correct?
Another solution would be to expose different constructor methods for each array type.

What do you suggest?

Many Thanks

Bye

Marco

Author:  MonkeybreadSoftware [ Fri Aug 24, 2012 4:31 pm ]
Post subject:  Re: REALArray element type

Variants are REALobject. Use property functions to load Type value and you have the type from where you can decide on which accessor property you use.

Greetings
Christian

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/