Do you think it would be useful to request an enhancement, ie a new function, perhaps something called DATATYPE
(DATATYPE(text))
Determines the type of data contained in text.
In the following example, the value of vdatatype is DATE,
Determines the type of data contained in text.
In the following example, the value of vdatatype is DATE,
| SET VAR vdatatype = (DATATYPE('10/31/2009')) |
The way I have done it so far (not very elegant, but it works) is to assign the value of whatever the user typed in to a predetermined variable with the data type set in advance, like this...
SET V vdata TEXT
FILLIN vdata USING 'Enter data'
SET V vdate DATE
SET V vdate = .vdata
IF vdata IS NOT NULL THEN
--ok, its a date, deal with it
GOTO nextstep
ENDIF
SET V vnumber INTEGER
SET V vnumber = .vdata
IF vnumber is NOT NULL THEN
--ok it is a number, deal with it
GOTO nextstep
ENDIF
etc...
Mike
-------------- Original message from "MikeB" <[email protected]>: --------------
> > There is a function called CVTYPE you can use to determine data type.
>
> That won't be of much help if the collection method is always of type
> TEXT. Emmitt's approach will be the least troublesome / unwieldy to use for
> a universal search value emanating from a DIALOG.
>
> ----- Original Message -----
> From: "jan johansen"
> To: "RBASE-L Mailing List"
> Sent: Saturday, October 31, 2009 9:06 AM
> Subject: [RBASE-L] - Re: How do I check the data type of user entered data?
>
>
> > There is a function called CVTYPE you can use to determine data type.
> >
> > What I did was to create a custom search form with a
> > Variable Edit to contain the string to search for,
> > Variable Radio Group to select what to search,
> > and a Variable List View to display the search results.
> >
> > There is another pretty slick method to search all your desired
> > columns but it is an example shown in the Super Advanced training.
> > So I don't believe I am at liberty to share it. If Razzak wants to
> > share it he can.
> >
> > Jan
> >
> >
> >
> > -----Original Message-----
> > From: mjsmd
> > To: [email protected] (RBASE-L Mailing List)
> > Date: Sat, 31 Oct 2009 08:11:47 -0400
> > Subject: [RBASE-L] - How do I check the data type of user entered data?
> >
> >
> > Hi all,
> > I want my user to be able to have the option of entering a birthday,
> > last name, client ID (an integer less than 999999) or a phone number
> > (a number greater than 1000000) in order to select the desired client.
> > What is the best way to determine the type of data that was entered?
> > Is there a funtion that returns the data type?
> >>
> >
>
>

