[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
TIMEVALID()
Determines whether a specified time is valid
------------------------------------------------------------------------------
Syntax
TIMEVALID(<cTime>) --> lValid
Argument
<cTime> Designates a character string that contains the time to
test.
Returns
TIMEVALID() returns .T. when <cTime> is a valid time; or .F. when
<cTime> is an invalid time.
Description
With input that requires time manipulation, writing your own UDF to
check time inputs was unavoidable up to now. TIMEVALID() permits
complete checking of a time designation. You can use this function
effectively with a VALID clause within a READ mask.
Note
. Note the format for time designations. There must always be
two digits for hours, minutes, seconds, and hundredths; otherwise,
the time it is regarded as invalid. Valid examples are "12",
"12:59", "12:59:59", and "12:59:59:99". By contrast, invalid
examples are "24", "12:60", or "12:1", and/or "12:". If you work
with time strings that are not completely filled and that you need to
check with TIMEVALID(), then they must be TRIMmed prior to the use of
TIMEVALID() (see following Examples).
Examples
. Using the VALID clause with TRIM, all valid times are
accepted, even if no seconds or minutes are specified:
cBegin := SPACE(11)
@ 5, 10 SAY "Please input time for beginning work:";
GET cBegin VALID TIMEVALID(TRIM(cBegin))
READ
. Using a VALID clause without TRIM, hours and minutes must be
specified, so that TIMEVALID() can confirm a valid time:
cBegin := SPACE(5)
@ 5, 10 SAY "Please input time for beginning work:";
GET cBegin VALID TIMEVALID(cBegin)
READ
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson