home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / reform / reformat.txt < prev    next >
Text File  |  1994-01-03  |  5KB  |  173 lines

  1. REFORMAT UTILITY
  2.  
  3.  
  4. The Reformat Utility is a Visual Basic program that Constructs an 
  5. output file from an input file based on control statements.  The 
  6. program also has the ability to unpack data fields in files that were 
  7. downloaded from the Host.
  8.  
  9. The program was designed to be called from another Windows 
  10. application (e.g. Access or Visual Basic)
  11.  
  12.  
  13. CONTROL STATEMENTS
  14.  
  15. Reformat.exe reads control statements from a parm data set called 
  16. Parms.txt.  It looks for this file in the same directory that the reformat 
  17. utility is in.
  18.  
  19. There are three type of control statements that must be specified in 
  20. the parm file, INPUT, OUTPUT and FIELD.
  21.  
  22. The first control statement must be the INPUT statement.  The format 
  23. for this statement is: INPUT=(pathname).  This identifies the input file.
  24.  
  25.     Example:   INPUT=(c:\utility\testin.txt)
  26.  
  27. The second control statement must be the OUTPUT statement.  The 
  28. format for this statement is:  OUTPUT=(pathname).  This identifies the 
  29. output file.
  30.  
  31.     Example   OUTPUT=(c:\utility\testout.txt)
  32.  
  33. The remaining control statements describe the parts of the input file 
  34. that are copied to the output file.  The format for this statement is: 
  35. FIELD=(starting position of input text, length of input text, [0 or 
  36. 1]).  The third parameter in the FIELD statement indicates if the input 
  37. data is in packed format or not.  0 indicates not packed data.  1 
  38. indicates packed data.
  39.  
  40.     Example:  FIELD=(18,34,0)       Last Name field
  41.  
  42. Note: Comments are allowed after the ending parenthesis.
  43.  
  44.  
  45.  
  46.  
  47. OUTPUT FILE
  48.  
  49. The output file is constructed by reading an input record and then 
  50. creating an output record based on the FIELD statements.  As each 
  51. FIELD statement is processed, that data is moved to the output record 
  52. and appended to the previous piece of data.
  53.  
  54.     Example:      FIELD=(3,10,0)
  55.                   FIELD-(20,5,0)
  56.  
  57. The output file in this case would contain 15 characters.  The first 10 
  58. characters in the output file would come from the input record 
  59. beginning at position 3.  The next five characters in the output file 
  60. would come from the input file beginning at position 20.
  61.  
  62. Input File:        ABCDEFGHIJKLMNOPQRSTUVWXYZ
  63.  
  64. Output File:    CDEFGHIJKLTUVWX
  65.  
  66.  
  67. PACKED DATA
  68.  
  69. To unpack data from the input file you must code the third parameter 
  70. of the FIELD statement as a 1.  This indicates to the reformat program 
  71. that the data in the input file is packed and must be unpacked in the 
  72. output file.  The length of the unpacked data in the output file is always 
  73. twice as long as the length of the packed data field.  The last character 
  74. of unpacked data always contains a "+" or "-" sign to indicate whether 
  75. the data is positive or negative.  If the packed data contains a "D" in 
  76. the sign position, the data is considered negative.  Anything else is 
  77. considered positive.
  78.  
  79.     Example 1:    FIELD=(3,3,1)
  80.  
  81. Input File:     (Hex)        41424309347F414243
  82.         (ASCII)    ABC---ABC
  83.  
  84. Output File:    (Hex)        30393334372B
  85.         (ASCII)    09347+
  86.  
  87.     Example 2:    FIELD=(3,3,1)
  88.  
  89. Input File:     (Hex)        41424309347D414243
  90.         (ASCII)    ABC---ABC
  91.  
  92. Output File:    (Hex)        30393334372B
  93.         (ASCII)    09347-
  94.  
  95. MAIN WINDOW
  96.  
  97. The Main Window of the Reformat utility has a graph which depicts the 
  98. progress of reformatting the input file.
  99.  
  100.  
  101.  
  102.  
  103.  
  104. PROGRAM MESSAGES
  105.  
  106. Write over pathname ?
  107.  
  108. The specified output file already exists.  The system asks if you want 
  109. to write over it.
  110.  
  111.  
  112. ERROR MESSAGES
  113.  
  114. Parms.txt file not found
  115.  
  116. The Parms.txt file was not found in the directory where the reformat 
  117. progam resides.
  118.  
  119. No INPUT parameter record
  120.  
  121. The INPUT control statement was not found or was not the first record 
  122. in the parameter file.
  123.  
  124. Error in INPUT statement
  125.  
  126. An error was found in the format of the INPUT control statement.
  127.  
  128.  
  129.  
  130. No OUTPUT parameter record
  131.  
  132. The OUTPUT control statement was not found or was not the first 
  133. record in the parameter file.
  134.  
  135. Error in OUTPUT statement
  136.  
  137. An error was found in the format of the OUTPUT control statement.
  138.  
  139. There are no FIELD statements
  140.  
  141. No FIELD statements were found in the Parameter file.
  142.  
  143. Error in Parm record ##  - image of parm record
  144.  
  145. An error was encountered while processing the FIELD statement.  The 
  146. number of the FIELD statement and an image of FIELD statement is 
  147. displayed.
  148.  
  149. Input file pathname not found
  150.  
  151. The file specified by the INPUT statement was not found.
  152.  
  153. Invalid Packed data in input record ##
  154.  
  155. The packed data did not contain only digits 0 - 9.  The input record 
  156. number is displayed.
  157.  
  158.  
  159. PROGRAM FILES
  160.  
  161. Reformat.exe  -  Compiled Visual Basic Program
  162.  
  163.  
  164. CONTROL FILES
  165.  
  166. Parms.txt    -  Contains Program control statements
  167.  
  168.  
  169. SYSTEM FILES IN \WINDOWS\SYSTEM DIRECTORY
  170.  
  171. VBRUN300.DLL  -  Visual Basic Run time file
  172. GAUGE.VBX       -  DLL for Gauge used in the program
  173.