home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / dbase / apform.zip / APFORMLK.SC < prev    next >
Text File  |  1990-12-02  |  1KB  |  58 lines

  1. ; Copyright (c) 1989/90 RichPlum Ltd.  All Rights Reserved.
  2. ;
  3. ;1. APFORMLK.SC will enable APFORM to run from within a PAL script.
  4. ;
  5. ;2. Instead of invoking APFORM.SC to initiate APFORM use APFORMLK.
  6. ;       eg: play "APFORMLK"
  7.  
  8. ;3. I would suggest that APFORM is invoked within a closed procedure
  9. ;   to enable all the APFORM variables to be released on return
  10.  
  11. ;variables:
  12. ;  retval      - set false if APFORM cannot be loaded, otherwise
  13. ;                retval is set true
  14.  
  15. ;  AP_message  - contains a message to be passed back to the calling
  16. ;                script
  17.  
  18. proc system_chk()
  19.   if version() < 3
  20.   Then beep
  21.        AP_message = "To execute APFORM you must be using PARADOX 3"
  22.        return false
  23.   Endif
  24.  
  25.   if memleft() < 57*1024
  26.   Then beep
  27.        AP_message = "APFORM requires a minimum of 57K to function"
  28.        return false
  29.   Endif
  30.  
  31.   return true
  32. endproc
  33.  
  34.   system_chk()             ;check that APFORM can be loaded
  35.  
  36.   release procs system_chk
  37.  
  38.   if not retval            ;return if APFORM not to be loaded
  39.   then return
  40.   endif
  41.  
  42.   APFORM_INIT = true      ;inform APFORM to reset its variables
  43.  
  44.   while retval
  45.         AutoLib = SDir()+"Apform"
  46.         APfinit()
  47.         release procs APFINIT
  48.  
  49.         if not retval
  50.         then quitloop
  51.         endif
  52.  
  53.         APForm()
  54.   endwhile
  55.  
  56.   AP_message = ""
  57.   return true ;"APFORM unloaded"
  58.