home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 15a / convdb2.zip / CONFILE.CMD < prev    next >
OS/2 REXX Batch file  |  1987-02-14  |  4KB  |  122 lines

  1. ************************************************************
  2. ************************************************************
  3. *****              File Converter  (c) COPYRIGHT 1983  *****
  4. *****  confile.cmd                 Data Based Advisor  *****
  5. *****                                                  *****
  6. *****  AUTHOR: Larry Eitel                             *****
  7. *****  DATE: October 29, 1983                          *****
  8. *****                                                  *****
  9. *****  called from con.cmd                             *****
  10. *****                                                  *****
  11. *****  PURPOSE:                                        *****
  12. *****  Get a valid files. One will be the PRIMARY      *****
  13. *****  file that will be appended to. The other file   *****
  14. *****  (SECONDARY) will contain the information that   *****
  15. *****  contains the information that will converted    *****
  16. *****  and added to the to file tion from the file     *****
  17. *****  that will be converted and added to the "to"    *****
  18. *****  file.                                           *****
  19. *****                                                  *****
  20. *****  DISCLAIMER:                                     *****
  21. *****  The author makes or implies no warranties       *****
  22. *****  regarding the operation or usefulness of this   *****
  23. *****  program.  It is recommended the user make       *****
  24. *****  backups of any valuable files.                  *****
  25. ************************************************************
  26. ************************************************************
  27. STORE t TO check
  28. DO WHILE check
  29.   STORE ' ' TO fromdriv
  30.   STORE '        ' TO fromfile
  31.   ***** Get drive letter
  32.   @ 05,00 SAY 'Enter the drive letter of the file to '+;
  33.   'convert from, <RET> to quit. ' GET fromdriv PICTURE '!'
  34.   READ
  35.   IF fromdriv= ' '
  36.     ERASE
  37.     RELEASE ALL
  38.     CANCEL
  39.   ENDIF fromdriv= ' ' 
  40.   ***** Get the name of the file to convert from
  41.   @ 06,00 SAY 'Enter the file to convert from, ' +;
  42.   '<RET> to list files. ' GET fromfile PICTURE 'XXXXXXXX' 
  43.   READ
  44.   ***** Get drive letter
  45.   IF fromdriv# ' ' 
  46.     STORE fromdriv+ ':' +fromfile TO fromck
  47.     STORE ' ON ' +fromdriv TO where
  48.   ELSE
  49.     STORE ' ' TO where
  50.     STORE fromfile TO fromck
  51.   ENDIF fromdriv# ' ' 
  52.   IF fromfile= ' ' 
  53.     ***** List available files on drive chosen
  54.     @ 7,0 SAY ' ' 
  55.     LIST FILE &where
  56.     ?
  57.     ? 'Press any key to continue' 
  58.     WAIT
  59.     ERASE
  60.     ? header
  61.     LOOP
  62.   ENDIF fromfile= ' ' 
  63.   ***** Make sure file chosen is on drive chosen
  64.   IF .not.FILE(fromck)
  65.     ?? chr(7)
  66.     SET inte OFF
  67.     @ 24,00 SAY 'That file was not found, try again.' 
  68.     SET inte ON
  69.     LOOP
  70.   ELSE
  71.     STORE f TO check
  72.   ENDIF
  73. ENDDO WHILE check
  74. @ 24,00 SAY '                                   '
  75. **** get the name of the file to append to
  76. STORE t TO check
  77. DO WHILE check
  78.   STORE ' ' TO todriv
  79.   STORE '        ' TO tofile
  80.   @ 07,00 SAY 'Enter the drive letter of the file to '+;
  81.   'append to, <RET> to quit. ' GET todriv PICTURE '!'
  82.   READ
  83.   IF todriv= ' '
  84.     ERASE
  85.     RELEASE ALL
  86.     CANCEL
  87.   ENDIF todriv= ' ' 
  88.   @ 08,00 SAY 'Enter the file to append to, ' +;
  89.   '<RET> to list files. ' GET tofile PICTURE 'XXXXXXXX' 
  90.   READ
  91.   IF todriv# ' ' 
  92.     STORE todriv+ ':' +tofile TO tock
  93.     STORE ' ON ' +todriv TO where
  94.   ELSE
  95.     STORE ' ' TO where
  96.     STORE tofile TO tock
  97.   ENDIF todriv# ' ' 
  98.   IF tofile= ' ' 
  99.     ***** List available files on drive chosen
  100.     @ 10,0 SAY ' ' 
  101.     LIST FILE &where
  102.     ?
  103.     ? 'Press any key to continue' 
  104.     WAIT
  105.     ERASE
  106.     ? header
  107.     LOOP
  108.   ENDIF tofile= ' ' 
  109.   ***** Make sure file chosen is on drive chosen
  110.   IF .not.FILE(tock)
  111.     ?? chr(7)
  112.     SET inte OFF
  113.     @ 24,00 SAY 'That file was not found, try again.' 
  114.     SET inte ON
  115.     LOOP
  116.   ELSE
  117.     STORE f TO check
  118.   ENDIF 
  119. ENDDO WHILE check 
  120. @ 24,00 SAY '                                   ' 
  121. RETURN
  122.