Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Protection Plus for Clipper - <u>pp_valdate()</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
PP_VALDATE()
Validates last date/time used
------------------------------------------------------------------------------

Syntax
  PP_VALDATE()  .  lResult

Returns
  .T. if the current date and time > last date and time used, .F.
  otherwise or on error.

Description
  Makes sure that the last date and time used, stored in the control
  file, is less than the current date and time.

Example

The following checks the date and the time to make sure that the
last date and time used is less than the current date and time.  If
not, the user is trying to "back up" the computer clock in order to
gain more time from your running demo or payment package.  This
check is only valid IF the current expire type is NOT "None"
(which means unlocked).  The test is run once.  If it fails, the user
can enter the new date and time.  If it still fails then he is given an
option to enter a code number.  This is just in case the user
accidentally forwards his DOS date to an advanced value and runs
the program and then sets it back correctly.  If you do not follow
this two step check as shown below, the user will NEVER be able
to set his clock back to the right date and run your application.
Upon entering the correct code number, the current DOS date and
time is saved into the last used date and time field in the control
file.  The code is found on the following page.

if !pp_valdate() .AND. pp_exptype()#"N"
    clear
    curr_date=date()
    curr_time=time()
    @ 2,0 say "Please set the date and time correctly:"
    ?
    ?
    run date
    @ 7,0 say ""
    run time
endif

if !pp_valdate() .AND. pp_exptype()#"N"
    clear
    @ 2,0 say "The date and time is still incorrect.  Please call"+;
        " technical support"
    @ 3,0 say "for assistance.              Code entry #:"+;
        ltrim(str(pp_cenum()))+"  Date: "+dtoc(date())
    get_code=0
    @ 5,0 say "Enter code: " get get_code picture "@Z"
    read
    if pp_ucode(get_code)=5   && arbitrary number chosen by you
        pp_upddate()
        pp_getvar()     && get new values since they just changed
    else
        clear
        cancel
    endif
endif

See Also: PP_UPDDATE() PP_UCODE()

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