Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invoking a procedure on a control on a form
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003336
Message ID:
01003340
Views:
15
>I have a procedure named basearti in a program called findart. Here is my program:
>
>
>PROCEDURE basearti()
>	STORE "F*0001" TO cArtikey
>ENDPROC
>
>
>When my form is shown in the text1 field I want to display the contents of the variable cArtikey.
>
>Can anybody help me in where I would put my code on the form or text1 control so that it shows the value of the variable cArtikey? Many Thanks

You can't make a procedure as a control sopurce because the procedure doesn't returns values. Make it function:
FUNCTION basearti()
   STORE "F*0001" TO cArtikey
   RETURN m.cArtikey
ENDFUNC
Add a property of your form and set The controlSource of the TextBox to it, in Init event of the form:

thisform.BaseArtiProp = BaseArti()
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform