Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input mask like a calculator for a numeric textfield
Message
From
29/07/1999 11:19:19
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00247677
Message ID:
00247697
Views:
26
>Go to Files, Classes/VCX. Jim Booth has a textbox number class which what you are looking for. There is also a second one called Textnum2 or something like that which is a modification of Jim's. Look for #'s 803 and 806.

Hey Mark!

I was playing with my idea to allow users to enter an expression (like 17+23) into the text box, and I ran into a conceptual problem, maybe you can throw me some advice.

I put the following code into a textbox.lostfocus()
if type('eval(this.value)') = "N" then
    this.value = eval(this.value)
endif
and I made the inputmask = "XXXXXXXXXXXX" so that any character could be entered. I created a form with my new textbox on it and a command button that had thisform.refresh in the click event.

Whenever I tab out of the field, or click on the command button, mytextbox gets replaced with all X. If I remove my inputmask, then the control works correctly the first time, and then throws away everything after the first + or - sign I input into the textbox. It will also not take a * or a / after the first time.

What am I missing here?
--Todd Sherman
-Wake Up! Smell the Coffee!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform