Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>validtime() time string entry check examplep.prg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ValidTime()    Time string entry check                 Examplep.prg


Syntax:        ValidTime(<expC>)

Argument:      <expC> is a time string in the form HH:MM:SS.

Returns:       True (.T.) if the time string is within the range of
               00:00:00 to 23:59:59.

Description:   ValidTime() is used with the VALID clause of @...GET to
               validate a time string.


----------------------------------- Example --------------------------------

   timestring = [  :  :  ]
   @ 10, 10 GET timestring PICTURE [99:99:99];
         VALID ValidTime(timestring)
   READ


--------------------------------- Source Code ------------------------------

   FUNCTION ValidTime

   PARAMETERS timestring
   *
   RETURN VAL(timestring)            < 24 .AND.;
          VAL(SUBSTR(timestring, 4)) < 60 .AND.;
          VAL(SUBSTR(timestring, 7)) < 60

.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson