Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Mar 22, 2018 12:34 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: REALArray element type
PostPosted: Tue May 15, 2012 4:07 am 

Joined: Wed Sep 10, 2008 3:22 pm
Posts: 27
Location: Italy
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



Reply with quote  
 Post subject: Re: REALArray element type
PostPosted: Fri Aug 24, 2012 4:31 pm 
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
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.


See you in Orlando, Florida for Real World 2013
More details and registration here:

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group