home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / Z3-33 / Z33ANOTE.001 < prev    next >
Text File  |  2000-06-30  |  2KB  |  37 lines

  1.                           ZCPR33 APPLICATION NOTES
  2.                           ========================
  3.  
  4. Note Number:    001
  5. Author:        Jay Sage
  6. Date:        June 6, 1987
  7.  
  8.  
  9.                  The Correct Value for Z3CLS in Z3BASE.LIB
  10.  
  11.  
  12.      In "ZCPR3, The Manual" Richard Conn nowhere explains in precise terms
  13. the value that should be used for Z3CLS, the size of the command line
  14. buffer.  Because of the way it is used in the command processor code, the
  15. correct value for this symbol is the maximum number of command characters
  16. that can fit in the command line buffer.  This count does not include the
  17. required terminating null.  An example should help make this clearer.
  18.  
  19.      Suppose you allocate the standard space of 0D0H bytes (208 decimal) for
  20. the multiple command line memory module.  The first two bytes are used as a
  21. pointer to the next command to execute.  The next byte contains the length
  22. of the buffer (Z3CLS) for use by the DOS read-line function.  The next byte
  23. will be filled in by the DOS read-line function to contain the actual length
  24. of the command line entered.  Finally, at offset 4 (the fifth byte) in the
  25. multiple command line buffer, the actual command line begins.  That leaves a
  26. total of 204 bytes for the complete command line.
  27.  
  28.      However, the DOS read-line function does not provide a null-terminated
  29. string as required by the command processor.  It indicates the length of the
  30. command string by the length byte described above.  The command processor
  31. uses that value to figure out where the terminating null (binary zero byte)
  32. should be placed and puts it there.  Thus there are only 203 character
  33. positions available to the DOS read-line function, and this is the correct
  34. value to use for Z3CLS.  The general rule is that Z3CLS should be assigned a
  35. value that is five less than the total size of the multiple command line
  36. module.
  37.