home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsm / notepad / export / EXPORT.OPL next >
Text File  |  1992-10-03  |  831b  |  48 lines

  1. PROC Export:
  2. local d%,c%,xfil$(128),p%,l%
  3. p%=pos
  4. top::
  5. dinit"Export Notepad as Text"
  6. dbuttons "Yes",%Y,"Cancel",27
  7. d%=dialog
  8. if d%=%y or d%=%Y
  9. xfil$="\"
  10. fn::
  11.  giprint"Path is "+parse$:(f$,1)+parse$:(f$,2)+"\"
  12.  dinit"Choose Filename"
  13.  dfile xfil$,"File:",19
  14. l%=2
  15.  dchoice l%,"Line numbers:","Yes,No"
  16.  if dialog=0
  17.   goto top
  18.  endif
  19.  first
  20.  trap lopen xfil$
  21.  if err
  22.   giprint err$(err)
  23.   goto fn
  24.  endif
  25.  busy"Exporting..."
  26.  lprint"Notepad Export File:  "+date$
  27.  lprint"---------------------------"
  28.  lprint"File: "+parse$:(f$,6)
  29.  lprint
  30.  do
  31.   if l%=1
  32.    lprint fix$(pos,0,4)+") "+mid$(d.n$,13,240)
  33.   else
  34.    lprint mid$(d.n$,13,240)
  35.   endif
  36.   next
  37.  until eof
  38.  busy off
  39.  giprint"Done"
  40.  beep 5,50
  41.  pause 30
  42.  giprint parse$:(xfil$,4)+" saved..."
  43.  pause 30
  44. trap lclose
  45. position p%
  46. endif
  47. ENDP
  48.