New topic: 

Property call

<http://forums.realsoftware.com/viewtopic.php?t=47904>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        mapmusic          Post subject: Property callPosted: Fri May 17, 
2013 3:43 am                         
Joined: Tue Oct 30, 2012 4:23 am
Posts: 20                Hello,

I have a idea, but I don know if it could work.

I need to pass PROPERTY to Function or Sub.

Sub MySub (Value as string, Prop as DontKnow)
  MyVar.Prop=Value
End Sub


Is possible something like this ?

Thanks

Martin      
_________________
---

@MacOS 10.7.5/MBPro  
                             Top                kermit          Post subject: 
Re: Property callPosted: Fri May 17, 2013 5:40 am                         
Joined: Mon May 30, 2011 12:56 am
Posts: 692                Quote:I need to pass PROPERTY to Function or Sub.

Why?

I have to assume that your example code is just an example.
because  MyControl.Property=Value does the job perfectly well

You dont need to do  MySub(Value,MyControl.value)
If the Mysub could put any old value into the property, then you only need a 
function:

MyControl.Property=MySub(Value)

Where (probably)  MySub()  returns a variant.  Sloppy, but possible.   
                             Top                mapmusic          Post subject: 
Re: Property callPosted: Fri May 17, 2013 6:17 am                         
Joined: Tue Oct 30, 2012 4:23 am
Posts: 20                Hello,

It is not control, but variable and property is defined by me. (variable is 
created via class)
I have MyClass with property1-property5
I have Variable Dim MyVar as MyClass

And now I have Sub where I want to process MyVar.propertyX
Code is equal for each property, but I want to select which property will be 
processed.

Now I have:
MySub (PropertyType as integer)
Select case PropertyType
case 1
  Code for MyVar.Property1
case 2
  Code for MyVar.Property2
  .
  .
  .
End Sub



And I need 

MySub (Something like Property)
Code for MyVar.ReceivedProperty
End Sub


Generally I want to use 1 code instead of X codes for each property

Thanks 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
   [ 3 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]

Reply via email to