home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / txttoipf.zip / txttoipf.rxx < prev   
Text File  |  1994-04-19  |  2KB  |  62 lines

  1. /*
  2.      Format a text file for IBM IPF facility
  3.      Program by Dennis Frost
  4.      
  5.      email:
  6.         dfrost@wvuvphs1.hsc.wvu.edu
  7.         dlfrost@miavx1.acs.muohio.edu     
  8. */
  9.  
  10. txtfile = ''
  11. ipffile = ''
  12. ipffile = arg(1)
  13. parse var ipffile txtfile ipffile
  14.  
  15. if (txtfile = '') | (ipffile = '') | (ipffile = 0) then
  16.         exit(0)
  17.  
  18.  
  19. do while lines(txtfile) = 1
  20.     tempchar = CHARIN(txtfile)
  21.     select
  22.     when tempchar = "&" then call CHAROUT ipffile, "&."
  23.     when tempchar = ":" then call CHAROUT ipffile, "&colon."
  24.     when tempchar = "^" then call CHAROUT ipffile, "&caret."
  25.     when tempchar = "'" then call CHAROUT ipffile, "&apos."
  26.     when tempchar = "*" then call CHAROUT ipffile, "&asterisk."
  27.     when tempchar = "\" then call CHAROUT ipffile, "&bslash."
  28.     when tempchar = '"' then call CHAROUT ipffile, '&cdq.'
  29.     when tempchar = "," then call CHAROUT ipffile, "&comma."
  30.     when tempchar = "-" then call CHAROUT ipffile, "&dash."
  31.     when tempchar = "$" then call CHAROUT ipffile, "&dollar."
  32.     when tempchar = "." then call CHAROUT ipffile, "&per."
  33.     when tempchar = "=" then call CHAROUT ipffile, "&eq."
  34.     when tempchar = "!" then call CHAROUT ipffile, "&xclm."
  35.     when tempchar = ">" then call CHAROUT ipffile, ">sym."
  36.     when tempchar = "<" then call CHAROUT ipffile, "<sym."
  37.     when tempchar = "{" then call CHAROUT ipffile, "&lbrace."
  38.     when tempchar = "[" then call CHAROUT ipffile, "&lbracket."
  39.     when tempchar = "(" then call CHAROUT ipffile, "&lpar."
  40.     when tempchar = "#" then call CHAROUT ipffile, "&numsign."
  41.     when tempchar = "`" then call CHAROUT ipffile, "&osq."
  42.     when tempchar = "%" then call CHAROUT ipffile, "&percent."
  43.     when tempchar = "+" then call CHAROUT ipffile, "&plus."
  44.     when tempchar = "}" then call CHAROUT ipffile, "&rbrace."
  45.     when tempchar = "]" then call CHAROUT ipffile, "&rbracket."
  46.     when tempchar = ")" then call CHAROUT ipffile, "&rpar."
  47.     when tempchar = ";" then call CHAROUT ipffile, "&semi."
  48.     when tempchar = "/" then call CHAROUT ipffile, "&slash."
  49.     when tempchar = "@" then call CHAROUT ipffile, "&atsign."
  50.     when tempchar = "|" then call CHAROUT ipffile, "&splitvbar."
  51.     when tempchar = "~" then call CHAROUT ipffile, "&tilde."
  52.     when tempchar = "_" then call CHAROUT ipffile, "&us."
  53.     otherwise
  54.         call CHAROUT ipffile, tempchar
  55.     end
  56. end
  57.  
  58. status = LINEOUT( txtfile )
  59. status = LINEOUT( ipffile )
  60.  
  61. exit(1)
  62.