Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing array
Message
From
18/12/2001 11:04:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
18/12/2001 10:46:34
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00595252
Message ID:
00595632
Views:
21
>Hilmar
>
>It worked as I expected, but I want to understand something...
>
>If I use Acopy( ), Im creating a copy from the first Array just with another name.
>
>Why cant I pass by reference to another form just the first array (form property)
>
>Like: DO FORM FORM2 WITH @ThisForm.aMyArray to lcReturn
>I tryed this in VFP 7.0 and it returned to me Sintax Error message.

Pressummably, the @ combined with the point is confusing syntax for VFP.

Now, the DO command (for a PRG) passes information by reference anyway. I am not sure how it works with a form.

Try:

DO FORM FORM2 WITH ThisForm.aMyArray, and see whether it works.

In FORM2, you would have to copy it to an array property anyway, I believe; parameters aren't available after Init() finishes.

Copying large arrays, of course, is inneficient, and this is probably what worries you.

You can avoid copying parameters altogether by passing a single parameter for the form.
* Form1.Button.Click()
do form FORM2 with ThisForm.

* Form2.Init()
lParameters toParentForm
This.oParentForm = toParentForm

* Form2, anywhere else
* Example: show element #5 form1.aMyArray
wait window transform(ThisForm.oParentForm.aMyArray(5) timeout 1
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform