home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / EX_APP3.OPL < prev    next >
Text File  |  1992-08-27  |  956b  |  72 lines

  1. APP myapp3
  2.     TYPE 3
  3.     ICON "\opd\me"
  4. ENDA
  5.  
  6.  
  7.  
  8. PROC start:
  9.     GLOBAL a%(6),k%,w$(128)
  10.     STATUSWIN ON
  11.     SCREEN 30,9,1,1
  12.     gSETWIN 0,0,179,79
  13.     w$=CMD$(2)
  14.      fset:(CMD$(3))
  15.   PRINT "Q to Quit"
  16.   PRINT " or press Delete in the"
  17.   PRINT "the System screen"
  18.   PRINT " or create/swap files in the"
  19.   PRINT "System screen"
  20.     DO
  21.         k%=getk%:
  22.         PRINT CHR$(k%);
  23.     UNTIL (k% AND $ffdf)=%Q
  24. ENDP
  25.  
  26.  
  27.  
  28. PROC getk%:
  29.     LOCAL t$(1)
  30.      DO
  31.         GETEVENT a%()
  32.         IF a%(1)=$404
  33.             w$=GETCMD$
  34.             t$=LEFT$(w$,1)
  35.             w$=MID$(w$,2,128)
  36.             IF t$="X"
  37.                 endit:
  38.             ELSEIF t$="C" OR t$="O"
  39.                 TRAP CLOSE
  40.                 IF ERR
  41.                     CLS :PRINT ERR$(ERR)
  42.                     GET :CONTINUE
  43.                 ENDIF
  44.                 fset:(t$)
  45.             ENDIF
  46.         ENDIF
  47.     UNTIL a%(1)<256
  48.     RETURN a%(1)
  49. ENDP
  50.  
  51.  
  52.  
  53. PROC fset:(t$)
  54.     LOCAL p%(6)
  55.     IF t$="C"
  56.         TRAP CREATE w$,A,A$
  57.     ELSEIF t$="O"
  58.         TRAP OPEN w$,A,A$
  59.     ENDIF
  60.     IF ERR
  61.         CLS :PRINT ERR$(ERR)
  62.         GET :STOP
  63.     ENDIF
  64.     SETNAME w$
  65. ENDP
  66.  
  67.  
  68.  
  69. PROC endit:
  70.     STOP
  71. ENDP
  72.