'**** HEADER ************************************************************
'EXDATE01.PF3 (release .02)
'Copyright (c) 1990-1991 Applied Resource Technologies, Inc.
'P.O. Box 64381, Dallas, Texas 75206 U.S.A. (214) 855-0449
'Description: Demonstrates chkdate()
'**** FUNCTION DECLARATIONS *********************************************
'library
external chkdate()                 'datelib
external messbox() fentrybox()     'uintlib
'core
'**** VARIABLE DECLARATIONS *********************************************
'library
public   ptstr                     'indirect return from fentrybox()
'core
'**** CODE **************************************************************

local indate

load "C:\smartii\poptools\lib\datelib.psl" in-memory
load "C:\smartii\poptools\lib\uintlib.psl" in-memory

indate = NULL
while TRUE
  if fentrybox("Enter a date (dd/mm/yyyy):",10, \
     "{{#{#}}\/{#{#}}\/{####}}",indate) = 0
     indate = ptstr
        if chkdate(indate,1) < 0
            beep
            messbox(indate&"is incorrect! Enter again (y/n) ?",1,0,1)
            if ptstr == "n"
               indate = NULL
               exit while
            end if
        else
            exit while
        end if
   else
     indate = NULL
     exit while
   end if
end while


