Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Procedures
Message
From
12/04/2005 09:59:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003677
Message ID:
01003717
Views:
16
>Hi Hilmar,
>
>Yes I would to store all my procedures in findart.prg. Then when I need them I will call them and do whatever.
>
>In this instance when my form runs I want to call the procedure then show the values from the variables in my form controls text1....text2.
>
>thanks

If I understand correctly, you want to call a procedure, return several values from the procedure, and have these values change form properties.

A procedure (or function) can return only one value.

One way to do what you want to do is to pass several values by reference:
* Calling procedure / form method:
do MyProc with @par1, @par2 ...

* and change the parameters in the called method.
Another method is to pass a single form object as a parameter:
* From your form:
do MyProc with ThisForm

* Called procedure:
lparameters toCallingForm
...
toCallingForm.Property1 = Value1
...
toCallingForm.SomeMethod()
...
toCallingForm.Label1.Caption = "Some Value"
I don't especially recommend the last line, because it violates encapsulation more than the others, i.e., the called procedure has to know too much about the internal details of how the form is set up.

Yet another method is to return a single value, made up of several pieces:
* called procedure
return "5;10;15"  && Values 5, 10, 15, combined into a single string
And separate the pieces in the calling form.

I hope that one of these alternatives helps you.

Regards,

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