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

  1. PROC draw:
  2.     local id%,wi%,ht%
  3.     local f$(128),buf%(100)
  4.     local h%,l%,o%
  5.     f$=cmd$(1)
  6.     while 1
  7.         dInit
  8.         dFile f$,"Icon:",0
  9.         if dialog=0 :stop :endif
  10.         l%=ioopen(h%,f$,$400)
  11.         if l% :goto cl2 :endif
  12.         l%=ioread(h%,addr(buf%(1)),200)
  13.         if l%<=140 :goto cl :endif
  14.         if buf%(1)<>%O+(%P*256) :goto cl :endif
  15.         if buf%(2)<>%L+(%O*256) :goto cl :endif
  16.         o%=23+(buf%(11) and $ff)
  17.         l%=peekw(addr(buf%(1))+o%)
  18.         if l%<>%P+(%I*256) :goto cl :endif
  19.         if l%=0 :goto cl :endif
  20.         call($5f8d,1,o%,0,0,0)
  21. cl::
  22.         ioclose(h%)
  23. cl2::
  24.         onerr t
  25.         id%=gLoadBit(f$)
  26.         wi%=gWidth :ht%=gHeight
  27.         gUse 1
  28.         gMove 0,0: gFill 240,80,1
  29.         gCopy id%,0,0,wi%,ht%,3
  30.         get
  31.         gClose id%
  32.         continue
  33. t::
  34.     onerr off
  35.     beep 5,300
  36.     endwh
  37. ENDP
  38.