Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters to generalised prompt/edit form
Message
From
11/02/2002 06:29:54
John Faithfull
Hunterian Museum, University of Glasgow,
Glasgow, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Passing parameters to generalised prompt/edit form
Miscellaneous
Thread ID:
00618212
Message ID:
00618212
Views:
59
Hello folks,

It's a few months since I did any VFP programming, and I'm feeling pretty dim.

I want to create a simple form which will allow the value of any variable to be displayed and/or edited. There are two parameters, the variable name, and a caption for the form. eg

do form "editvar.scx" with "dInitdate", "Enter the starting date"

Will allow the user to see the current value of dInitdate, and edit it if desired.

The parameters cVarname and cCaption are passed as lparameters to the Init event of the form.

Two questions:

(1) How do I display the current value of the variable in a Text Box (eg dInitdate in the above example)? I've tried various variations on

dCurVal=evaluate(cVarname)

without consistent success.

(2)Secondly, once changed, how do I update the value of the original variable when the OK button is pressed? &cVarname=dCurVal seems to work in the command window, but gives an error in the Click event of the button.

Can anybody help, or point to some existing example which will carry out the same function? Ideally, for any variable whether date, character or numeric...

Apologies if this is not very clearly expressed...

Thanks

John
Dr. JW Faithfull
Curator in Geology
Hunterian Museum
University of Glasgow
Glasgow G12 8QQ
Scotland
Next
Reply
Map
View

Click here to load this message in the networking platform