home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol023 / misc.doc < prev    next >
Text File  |  1984-04-29  |  2KB  |  39 lines

  1. SOME MISCELLANEOUS LIBRARY ROUTINES I'VE TOSSED IN
  2.  
  3. GETINT.LIB
  4. You pass a message and the minimum and maximum values and this function
  5. asks for a value to be entered. It will not proceed until the value
  6. falls within the designated limits. This avoids unpleasant surprises
  7. when someone enters bad data. I'm afraid compilers aren't quite as
  8. unforgiving of this problem as are interpreters. Often, a lot of data
  9. is lost through a little foul-up.
  10.  
  11. CAPCHAR.LIB
  12. CAPSTR.LIB
  13. The former makes lower case letters into cap ones, the latter passes
  14. through a string capitalizing where necessary. Numbers and symbols
  15. are unaffected.
  16.     I'm not sure, but I suspect that the boolean comparison used
  17. here is more efficient than the set-inclusion test used in Z-UG's
  18. STRLIB.
  19.  
  20. PADSTR.LIB
  21. DEPAD.LIB
  22. PADSTRr sticks spaces at the end of a string until is hits the length
  23. passed as part of the function call. I implemented this as a function
  24. so that the original string can be left intact if desired.
  25.     This serves two purposes:
  26.     [1] Pretty printouts, since ver 3.2 pads strings to the left, just
  27. like numbers, rather than to the right, which means that simply going
  28. str:20 isn't satisfactory.
  29.     [2] Microsoft stores strings in random access records padded with
  30. blanks rather than with a length byte [used in Pascal/Z]. Personally,
  31. InterSystem's approach has its advantages, since you get back exactly
  32. what you stored, rather than a fixed-length string. But I also have
  33. SuperSort, which does not support the length byte [although it can
  34. always be passed over in setting up the keys], which means that padding
  35. the stored records prevents unpleasant surprises during the sort.
  36.     DEPAD starts dropping spaces off the right side of a string until
  37. it hits the first non-space character. Again, this is a function rather
  38. than a procedure, in case the original string needs to be left intact.
  39.