home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / rolwps10.zip / roltorow.cmd < prev    next >
OS/2 REXX Batch file  |  1994-05-26  |  4KB  |  133 lines

  1. /*   Rolodex/2  to  RoloWPS/2  */
  2.  
  3. rolodexfile = ""
  4. rolowpsfile = ""
  5.  
  6. parse arg rolodexfile rolowpsfile extraarg
  7.  
  8. if ((rolodexfile = "") | (rolowpsfile = "")) then
  9.     do
  10.     say "dextowps.cmd   rolodex/2.rol    rolowps/2.rol"
  11.     exit(-1)
  12.     end
  13.  
  14. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  15. call SysLoadFuncs
  16.  
  17. rolocheck       = LINEIN(rolodexfile,1,1)
  18. rolover         = LINEIN(rolodexfile)
  19.  
  20. if ((rolocheck <> 'Rolodex') | (rolover <> 'Version 3.0')) then
  21.     do
  22.     say "This is not a rolodex/2 version 2.05 file"
  23.     exit(-1)
  24.     end
  25.  
  26.  
  27. names.0 = LINEIN(rolodexfile)
  28. if names.0 == '' then exit(-1)
  29.  
  30. tempfile = SysTempFileName(rolo????.tmp)
  31.  
  32. group1 =    LINEIN(rolodexfile)
  33. group2 =    LINEIN(rolodexfile)
  34. group3 =    LINEIN(rolodexfile)
  35. group4 =    LINEIN(rolodexfile)
  36. group5 =    LINEIN(rolodexfile)
  37. group6 =    LINEIN(rolodexfile)
  38.  
  39. call lineout rolowpsfile, "RoloWPS"
  40. call lineout rolowpsfile, "Version 1.0"
  41. call lineout rolowpsfile, group1
  42. call lineout rolowpsfile, group2
  43. call lineout rolowpsfile, group3
  44. call lineout rolowpsfile, group4
  45. call lineout rolowpsfile, group5
  46. call lineout rolowpsfile, group6
  47. call lineout rolowpsfile, names.0
  48.  
  49.  
  50. do count = 1 to names.0
  51.  
  52.         names =    LINEIN(rolodexfile)
  53.         mailnames = LINEIN(rolodexfile)
  54.         addresslength =  LINEIN(rolodexfile)
  55.         addresss = CHARIN(rolodexfile,,addresslength)
  56.         status =         LINEIN(rolodexfile)
  57.         citys =    LINEIN(rolodexfile)
  58.         states =   LINEIN(rolodexfile)
  59.         zips =     LINEIN(rolodexfile)
  60.         companys = LINEIN(rolodexfile)
  61.         titles =   LINEIN(rolodexfile)
  62.         phones =   LINEIN(rolodexfile)
  63.         hphones =  LINEIN(rolodexfile)
  64.         faxs =     LINEIN(rolodexfile)
  65.         emails =   LINEIN(rolodexfile)
  66.         ftps =     LINEIN(rolodexfile)
  67.         bbss =     LINEIN(rolodexfile)
  68.         notelength =     LINEIN(rolodexfile)
  69.         notes =    CHARIN(rolodexfile,,notelength)
  70.         status =         LINEIN(rolodexfile)
  71.         group1s =  LINEIN(rolodexfile)
  72.         group2s =  LINEIN(rolodexfile)
  73.         group3s =  LINEIN(rolodexfile)
  74.         group4s =  LINEIN(rolodexfile)
  75.         group5s =  LINEIN(rolodexfile)
  76.         group6s =  LINEIN(rolodexfile)
  77.  
  78.  
  79.     first = ""
  80.     middle = ""
  81.     last = ""
  82.     parse var names last first middle
  83.  
  84.     ok = lineout(tempfile, addresss, 1)
  85.     status = lineout(tempfile)
  86.     tempaddress1 = ""
  87.     tempaddress2 = ""
  88.     tempaddress3 = ""
  89.     tempaddress1 = linein(tempfile,1)
  90.     tempaddress2 = linein(tempfile)
  91.     tempaddress3 = linein(tempfile)
  92.     status = lineout(tempfile)
  93.  
  94.  
  95.     call lineout rolowpsfile, last
  96.     call lineout rolowpsfile, first
  97.     call lineout rolowpsfile, middle
  98.     call lineout rolowpsfile, mailnames
  99.     call lineout rolowpsfile, companys
  100.     call lineout rolowpsfile, titles
  101.     call lineout rolowpsfile, tempaddress1
  102.     call lineout rolowpsfile, tempaddress2
  103.     call lineout rolowpsfile, tempaddress3
  104.     call lineout rolowpsfile, citys
  105.     call lineout rolowpsfile, states
  106.     call lineout rolowpsfile, zips
  107.     call lineout rolowpsfile, " "
  108.     call lineout rolowpsfile, phones
  109.     call lineout rolowpsfile, hphones
  110.     call lineout rolowpsfile, faxs
  111.     call lineout rolowpsfile, emails
  112.     call lineout rolowpsfile, ftps
  113.     call lineout rolowpsfile, bbss
  114.     call lineout rolowpsfile, icons
  115.     call lineout rolowpsfile, group1s
  116.     call lineout rolowpsfile, group2s
  117.     call lineout rolowpsfile, group3s
  118.     call lineout rolowpsfile, group4s
  119.     call lineout rolowpsfile, group5s
  120.     call lineout rolowpsfile, group6s
  121.     notelength = LENGTH(notes)
  122.     call LINEOUT rolowpsfile, notelength
  123.     call LINEOUT rolowpsfile, notes
  124.  
  125.     end
  126.  
  127. status = LINEOUT(rolodexfile)
  128. status = LINEOUT(rolowpsfile)
  129. call SysFileDelete tempfile
  130.  
  131. exit(0)
  132.  
  133.