Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 23, 2017 3:48 pm
xojo

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 
Offline

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

Bye

Marco


Top
 Profile  
Reply with quote  
 Post subject: Re: REALArray element type
PostPosted: Fri Aug 24, 2012 4:31 pm 
Offline
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.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group