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

  1. PROC format:
  2.     local ret%,fh%,c%,i%,v%
  3.     ret%=ioopen(fh%,"LOC::B:\Name.nam",$40)
  4.     if ret%<0 :goto exit :endif
  5.     ret%=iow(fh%,1,c%,#0)
  6.     if ret%<0 :goto cleanup :endif
  7.     print "Total format count",c%
  8.     get
  9.     while 1
  10.         ret%=iow(fh%,1,v%,#0)
  11.         if ret%<0 :break :endif
  12.         i%=i%+1
  13.         print "Format count",i%
  14.     endwh
  15.     if ret%=-36 :rem successful completion
  16.         ret%=0
  17.     endif
  18. cleanup::
  19.     ioclose(fh%)
  20. exit::
  21.     if ret%<0
  22.         print "Format failed"
  23.         print err$(ret%)
  24.     else
  25.         print "Format succeeded"
  26.     endif
  27.     get
  28. ENDP
  29.