Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Jun 24, 2017 12:19 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Setting structure or a property based on a structure to NIL
PostPosted: Thu Mar 07, 2013 7:03 am 
Offline

Joined: Thu Dec 22, 2005 9:58 am
Posts: 68
ie) adt_a01_prop = NIL

does not work

I have a look that populates a structure and at the end of the loop iteration wish to clear the property in one statement, rather than set each field = ""


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting structure or a property based on a structure to
PostPosted: Thu Mar 07, 2013 7:37 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Structures can't be set to Nil, but you can empty them out by assigning an empty string to its StringValue method.

dt_a01_prop.StringValue(TargetLittleEndian) = ""

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting structure or a property based on a structure to
PostPosted: Fri Mar 08, 2013 8:26 am 
Offline

Joined: Thu Dec 22, 2005 9:58 am
Posts: 68
Yes, I ended up doing that but I had 3 properties based on structures, with over 100 members each. A pain in the A$$


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting structure or a property based on a structure to
PostPosted: Fri Mar 08, 2013 11:38 am 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
breamer wrote:
Yes, I ended up doing that but I had 3 properties based on structures, with over 100 members each. A pain in the A$$

Use classes instead ?

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting structure or a property based on a structure to
PostPosted: Fri Mar 08, 2013 12:27 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
npalardy wrote:
breamer wrote:
Yes, I ended up doing that but I had 3 properties based on structures, with over 100 members each. A pain in the A$$

Use classes instead ?


and maybe even an array (or collection) of classes if you have 100 instances

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting structure or a property based on a structure to
PostPosted: Fri Mar 08, 2013 2:28 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Yeah, sounds like a misuse of structures. Create a class instead. Structures are for communicating with the outside world in a fixed block data structure. Internally, they're the wrong solution 99.9% of the time.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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