Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
InputBox
Message
From
29/10/1998 16:47:03
 
 
To
29/10/1998 15:10:14
Joe Norton
Science Application International Corp
Reston, Virginia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00152478
Message ID:
00152527
Views:
22
>Is there a function to produce an InputBox similar to the MessageBox() and the VB InputBox functions? I want the user
>to enter a value in a text box and then pass this value to
>a routine. I could simply create a form, but we all know that
>more functionality would be added. I just want a simple title,
>label, textbox and a button. Any thought would be appreciated,
>Joe.

There is no native function for this.
I have created a modal form for this purpose though, and I use it everywhere. It receives two optional parameters: A caption for the label on the form and an input mask for the text box. The form returns whatever value the user entered.

So I call the form with
DO FORM Gettext WITH "Enter a telephone number:","999-999-9999" TO lcTel

In the init of the form, I check to see if a caption was passed, and if so, set the labels caption property to the passed caption. I then check to see if an inputmask was passed, and set the textbox's inputmask to this parameter. You could go even further by allowing for numeric only (spinner) input or have the textbox and form dynamically size itself according to the caption and inputmask.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform