Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / FoxPro / Grids / July 2008

Tip: Looking for answers? Try searching our database.

Enter numaric only

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc - 10 Jul 2008 05:36 GMT
I have a gird. One column in that grid is numaric.
I want to allow enter only numaric values to that text boxes. Can I do that
using 'Format' or 'InputMask'
eg:- 325.124
      2342
Stefan Wuebbe - 10 Jul 2008 07:44 GMT
>I have a gird. One column in that grid is numaric.
> I want to allow enter only numaric values to that text boxes. Can I do that using
> 'Format' or 'InputMask'
> eg:- 325.124
>       2342

When yourGrid.Column.ControlSource is a numeric type, VFP
would prevent attempts to type non-digits anyway
   CREATE CURSOR temp (test Int)
   INSERT INTO temp VALUES (5)
   BROWSE NAME oGrid

But as you said, you can use the .Format and .InputMask properties
additionally, say when you want to have a limited length
   oGrid.Column1.InputMask = '9999'

hth
-Stefan

Signature

|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
 - /  See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------

Marc - 10 Jul 2008 09:52 GMT
Thanks Stefan

Another problem I have.
I have a text field in a form. In that text field I want allow to enter
Numaric and Floats. eg: 22.12,  222
When I set the Textbox .Value to 0 then I can enter numaric values only
can't enter decimal points. If I set the inputmask then the return value of
the Textbox is Character. But I want the textbox return value as Numaric.
Pls Hlp me

>>I have a gird. One column in that grid is numaric.
>> I want to allow enter only numaric values to that text boxes. Can I do
[quoted text clipped - 19 lines]
>  - /  See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
Stefan Wuebbe - 11 Jul 2008 17:55 GMT
> Thanks Stefan
>
[quoted text clipped - 5 lines]
> the Textbox is Character. But I want the textbox return value as Numaric.
> Pls Hlp me

That sounds as if your textbox is not bound to a field and .ControlSource
is probably empty right? In the command window I tried this

   _screen.AddObject('Text1','Textbox')
   _screen.Text1.Value = 0.00
   _screen.Text1.Visible = .T.

which seems to do what you want?

On the other hand, after setting an Inputmask
   _screen.Text1.InputMask = '999,999.99'

the VarType(_screen.Text1.Value) was still numeric for me, so I am
not sure whether something is different in your setup?

hth
-Stefan

Signature

|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
 - /  See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.