home *** CD-ROM | disk | FTP | other *** search
/ Kids Cube / 1_Art.iso / txpnt17 / bat2exec.doc < prev    next >
Text File  |  1990-07-31  |  3KB  |  65 lines

  1. BAT2EXEC
  2.  
  3. Doug Boling  -  Volume 9, Issue 14  -    August 1990 
  4.  
  5. Purpose:  Compile your batch files for added speed. Large batch 
  6.           files often run annoyingly slowly.  Compiling them with 
  7.           BAT2EXEC will increase both your productivity and satisfaction.
  8.  
  9.  
  10. Daily PC operations are almost unimaginable without the use of batch 
  11. files.  Everyone has his favorite collection of them, and some users 
  12. have constructed complex batch files of thousands of bytes that push 
  13. the batch langauge itself to its limits.  Programs that expand the 
  14. available batch file functions, such as Michael Mefford's BATCHMAN, 
  15. encourage users to make even larger batch files.
  16.  
  17. Unfortunately, however, batch files are also notoriously slow.  
  18. It can be almost painful to watch them scroll down the screen a line 
  19. at a time.  A standard way to improve the speed of interpreted 
  20. programs, such as batch files, is to compile them.  That's where 
  21. BAT2EXEC comes in.  
  22.  
  23. USING BAT2EXEC
  24.  
  25. The full syntax for BAT2EXEC could hardly be simpler.  Just enter:
  26.  
  27.      BAT2EXEC FILE.BAT
  28.  
  29. where FILE.BAT is the name of your batch file.  BAT2EXEC will then 
  30. produce an executable .COM file with the name FILE.COM.  If BAT2EXEC 
  31. can't find the batch file, an error message will be printed.  If 
  32. BAT2EXEC can't understand a line in the batch file, it will print an 
  33. error message indicating the line in the file in which it discovered 
  34. the error.
  35.  
  36. BAT2EXEC should not be used on every batch file.  AUTOEXEC.BAT, for
  37. example, must remain a genuine batch file in order for COMMAND.COM to
  38. find it.  Similarly, batch files that run terminate and stay resident
  39. utilities (TSRs) should not be compiled.  The reason for this
  40. limitation lies in the DOS memory management structure:  if a TSR is
  41. executed from a program compiled by BAT2EXEC, the memory used by
  42. BAT2EXEC itself will not be made available to the system after 
  43. it terminates.
  44.  
  45. Programs created by BAT2EXEC behave slightly differently from the 
  46. batch files from which they were compiled.  The .COM file does not 
  47. echo each line to the screen as does the batch file, for example.  
  48. Running other batch files does not cause the .COM program to end.  
  49. Also, pressing Ctrl-Break does not present the message, "Terminate 
  50. Batch file (y/n)."  If Ctrl-Break is pressed and BREAK has been set 
  51. on, the program simply terminates.
  52.  
  53. The size of the resulting .COM file is somewhat larger than 
  54. the batch file.  Compiling a batch file containing a single REM 
  55. statement results in a .COM file size of 68 bytes, illustrating the 
  56. overhead of the setup and terminate routines.  Program size increases 
  57. quickly as routines are added then slows as the loaded routines are 
  58. reused instead of new ones being added.
  59.  
  60. Certainly, BAT2EXEC is not suitable for use on every batch 
  61. file.  Two and three line batch files are best left in their easy-to-
  62. alter and simple-to-understand ASCII format.  However, for those batch 
  63. files that have grown into long complex programs, BAT2EXEC is the 
  64. answer.
  65.