New topic: Declare variable with own properties
<http://forums.realsoftware.com/viewtopic.php?t=46838> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message mapmusic Post subject: Declare variable with own propertiesPosted: Wed Feb 06, 2013 8:30 am Joined: Tue Oct 30, 2012 4:23 am Posts: 13 Hello, I need to use my own varieble which has own newly created properties. E.g. I need to declare array variable XXX (Variant ?), which will contains additional properties. Example: I need something like this XXX().Name as String XXX().Format as String XXX().Note as String XXX().Available as Boolean Maybe I am on wrong way to store more values for one type. Is there way to add properties to variables ? Thanks a lot Martin _________________ --- @MacOS 10.7.5/MBPro Top Markus Winter Post subject: Re: Declare variable with own propertiesPosted: Wed Feb 06, 2013 9:09 am Joined: Sun Feb 19, 2006 4:00 pm Posts: 1247 Location: Heidelberg, Germany Create a new class, give it the properties you need, then declare a variable D as new myClass Top ktekinay Post subject: Re: Declare variable with own propertiesPosted: Wed Feb 06, 2013 9:15 am Joined: Mon Feb 05, 2007 5:21 pm Posts: 429 Location: New York, NY Create a new class and add your properties to that. Say it's called "MyClass": dim m as new MyClass m.NameProp = "John" .. If you need to store many of these in an array: dim arr() as MyClass dim m as new MyClass m.NameProp = "John" arr.Append m arr( 0 ).FormatProp = "something" _________________ Kem Tekinay MacTechnologies Consulting http://www.mactechnologies.com/ Need to develop, test, and refine regular expressions? Try RegExRX. Top mapmusic Post subject: Re: Declare variable with own propertiesPosted: Wed Feb 06, 2013 9:50 am Joined: Tue Oct 30, 2012 4:23 am Posts: 13 Thanks ! Worked perfectly also with global instance. Best Martin _________________ --- @MacOS 10.7.5/MBPro Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
