Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter array
Message
From
09/11/2011 12:41:36
 
 
To
09/11/2011 11:11:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 5
OS:
Windows 7
Miscellaneous
Thread ID:
01528475
Message ID:
01528515
Views:
47
OK, thanks.

>Use a parameter object. In other words, add all the properties to an object, and pass the name of this object as a parameter. That's the "correct OOP" way to do it.
>
>>Tore:
>>
>>Please see Sergei's answer.
>>
>>I wanted a solution that allows me to pass a bunch of parameters NOT an array.
>>
>>Thanks,
>>
>>Yossi
>>
>>>You can pass an array by reference
>>>Local Array myArray(1)
>>>Dimension myArray(5)
>>>myArray(1) = [One]
>>>myArray(2) = [Two]
>>>myArray(3) = [Three]
>>>myArray(4) = [Four]
>>>myArray(5) = [Last]
>>>
>>>foo(@myArray)
>>>
>>>Function foo
>>>   parameters myArray
>>>   ?myArray(1)
>>>   ?myArray(2)
>>>   ?myArray(3)
>>>   ?myArray(4)
>>>   ?myArray(5)
>>>Endfunc
>>>>Tore:
>>>>
>>>>Sorry for the confusion. apara does not exist. I was hoping that there is a similar function in VFP, so I provided pseudocode to show what I'm looking for. I'm asking if there is any way to reference the parameters in an array-driven way.
>>>>
>>>>Thanks,
>>>>
>>>>Yossi
>>>>
>>>>>Must be on your machine only, I get an error, "File 'apara.prg' does not exist."
>>>>>
>>>>>>Hi All:
>>>>>>
>>>>>>Is there a parameter array?
>>>>>>
>>>>>>
>>>>>>foo('one', 'two', 'three')
>>>>>>
>>>>>>return
>>>>>>
>>>>>>Function foo(dog, cat, hen)
>>>>>>
>>>>>>? aPara(1)   &&displays 'one'
>>>>>>? dog           &&displays 'one'
>>>>>>? aPara(2)   &&displays 'two'
>>>>>>? aPara(3)   &&displays 'three'
>>>>>>
>>>>>>
>>>>>>return
>>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform