home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / z3help / y.lbr / ZSLIB6.HZP / ZSLIB6.HLP
Encoding:
Text File  |  1991-08-11  |  7.1 KB  |  167 lines

  1.  Parse Command Line Date and Time     - SPARSDS, PARSDT
  2.  Scan for Character                   - PARCHR
  3.  Count Command Line Parameters        - PARCNT
  4.  Get Specified Parameter              - PARGET
  5.  Skip Blanks or Non-blanks            - EATSPC, EATNSPC
  6.  Change Character Case                - UNCAPS, REVCAS
  7.  Get Program Name                     - GCOMNAM
  8. :
  9. SPARSDS - Parses date and time specifications for file stamps.
  10.  
  11.   ENTER: HL = address of datespec (14 characters or less),
  12.          DE = address of initialized memory buffer (5 bytes),
  13.          A = date format flag (0=American, FFh=European).
  14.   EXIT : Zero flag set (Z) if memory buffer contains valid BCD date/time:
  15.            A = 2Ah ("*") if wildcard character encountered,
  16.            A = 0 if no wildcard or invalid characters encountered,
  17.          Zero flag reset (NZ), if parsed datespec was out of range or an
  18.            invalid character was encountered.
  19.   USES : AF
  20.  
  21. PARSDT -- Parse date and time specification of system clock.
  22.  
  23.   ENTER: HL = address of datespec (16 characters or less),
  24.          DE = address of initialized memory buffer (6 bytes),
  25.          A = date format flag (0=American, FFh=European).
  26.   EXIT:  A = 0, zero flag set (Z), if memory buffer contains valid BCD date
  27.            and time,
  28.          A <> 0, zero flag reset (NZ), if parsed datespec was out of range
  29.            or an invalid character was encountered.
  30.   USES:  AF
  31.  
  32. SPARSDS and PARSDT (continued)
  33.  
  34. Usage: Parsing by SPARSDS and PARSDT is dependent on how the memory buffer 
  35. is initialized.  If the buffer is initialized to all FFh's, then only a 
  36. complete datespec is accepted.  If the buffer is initialized with a valid 
  37. BCD date and time string, the initialized values will be used for any 
  38. element missing from the datespec.  (Any individual element of the buffer 
  39. may be initialized to FFh to force entry of that particular element.) For 
  40. example, if "//yy" or "..yy" are entered, only the year byte in the entry 
  41. buffer will be changed.  If a colon is used in the datespec (e.g., "15:" 
  42. for 3 p.m.) then the "//" date delimiters are not needed.
  43.  
  44. Wildcard characters ("*", "?", or "??") are considered illegal by PARSDT, 
  45. but are accepted by SPARSDS.  If wildcard characters are detected by 
  46. SPARSDS, they are stored as ASCII "*" (2Ah) and A = 2Ah on return.  Your 
  47. application can handle wildcards as you see fit.
  48.  
  49. Parsing will stop when an illegal character is encountered in the datespec 
  50. and NZ will be returned.  An illegal character encountered while checking 
  51. for the timespec will not be flagged as an error, which can be useful in 
  52. detecting a trailing option list.  Your application can handle this 
  53. situation as you see fit.
  54.  
  55. SPARSDS and PARSDT (continued)
  56.  
  57. If the date format byte in A is non-zero, the command line datespec for 
  58. PARSDT takes the following forms (European date format):
  59.      {{dd}.{mm}.{yy}} {{hh}:{mm}:{ss}}  [real time]
  60. or
  61.      {{dd}.{mm}.{yy}} {+nnnn}           [relative time]
  62.  
  63. If date format byte in A is zero, the command line datespec takes the 
  64. following forms (American date format):
  65.      {{mm}/{dd}/{yy}} {{hh}:{mm}:{ss}}  [real time]
  66. or
  67.      {{mm}/{dd}/{yy}} {+nnnn}           [relative time]
  68.  
  69. All items in braces are optional.  Each date or time element may be two 
  70. ASCII digits or less.
  71.  
  72. The command line datespec for SPARSDS takes the same form, except that 
  73. seconds are not parsed.
  74. :
  75. PARCHR - Scans string for specified character.
  76.  
  77.   ENTER: A = character to search for,
  78.          HL = address of null-terminated string.
  79.   EXIT:  A = character, zero flag reset (NZ), if found,
  80.          A = 0, zero flag set (Z), if not found,
  81.          HL = address of found character or null terminator.
  82.   USES:  AF, HL
  83.  
  84. Usage: Stops at first match.  Does not scan for ^@ (null).
  85. :
  86. PARCNT - Count command line parameters.
  87.  
  88.   ENTER: HL = address of null-terminated command line string.
  89.   EXIT:  A = number, zero flag reset (NZ), if parameters found,
  90.          A = 0, zero flag set (Z), if no parameters found.
  91.   USES:  AF
  92.  
  93. Usage: On entry HL should point to the second byte of the default DMA 
  94. buffer (81h), unless the command line has been moved elsewhere in memory.  
  95. Parameters are expected to be delimited by spaces or tabs.
  96. :
  97. PARGET - Get address of specified command line parameter.
  98.  
  99.   ENTER: A = number of the desired command line parameter,
  100.          HL = address of null-terminated command line string.
  101.   EXIT:  A = first character of parameter, zero flag reset (NZ), if found,
  102.          A = 0, zero flag set (Z), if not found,
  103.          HL = address of parameter, if found.
  104.   USES:  AF, HL
  105.  
  106. Usage: On entry HL should point to the second byte of the default DMA 
  107. buffer (81h), unless the command line has been moved elsewhere in memory.  
  108. Parameters are expected to be delimited by spaces or tabs.
  109. :
  110. EATSPC - Skips spaces and tabs.
  111.  
  112.   ENTER: HL = address of null-terminated string.
  113.   EXIT:  HL = address of first non-blank character,
  114.          A = found character, zero flag reset (NZ), if non-blank found,
  115.          A = 0, zero flag set (Z), if null encountered.
  116.   USES:  AF, HL
  117.  
  118. EATNSPC - Skips characters not spaces, tabs, or nulls.
  119.  
  120.   ENTER: HL = address of null-terminated string.
  121.   EXIT:  HL = address of first blank or null character,
  122.          A = found character, zero flag reset (NZ), if blank found,
  123.          A = 0, zero flag set (Z), if null encountered.
  124.   USES:  AF, HL
  125.  
  126. Usage:  All characters that are not spaces or tabs are considered non- 
  127. blanks.  These routines are smaller than SYSLIB's SKSP and SKNSP and set 
  128. the zero flag if the end of the string is encountered.
  129. :
  130. UNCAPS - Lower-cases a character.
  131.  
  132.   ENTER: A = character.
  133.   EXIT:  A = character in lower-case.
  134.   USES:  AF
  135.  
  136. REVCAS - Reverses the case of a character.
  137.  
  138.   ENTER: A = character.
  139.   EXIT:  A = character with case reversed.
  140.   USES:  AF
  141.  
  142. Usage: These routines reset the character's high bit.  If the entry 
  143. character is alphabetic, UNCAPS always returns a lower-case character.  
  144. REVCAS returns a lower-case character, if the entry character is upper- 
  145. case; it returns an upper-case character, if the entry character is lower- 
  146. case.
  147. :
  148. GCOMNAM -- Get and store program's invocation name.
  149.  
  150.   ENTER: HL = address of default program name (space terminated)
  151.   EXIT:  COMNAM (global) = program name (null-terminated).
  152.   USES:  None
  153.  
  154. Usage: Gets program's invocation name from ZCPR3 external file control 
  155. block, if it exists.  If not, the default program name is stored.  The 
  156. default program name must be either 8 characters long or terminated by a 
  157. space character.  The program name (minus any trailing spaces) is stored as 
  158. a null-terminated string at public label COMNAM (global) that can be 
  159. accessed by print routines such as HPSTR and SYSLIB's PSTR and EPSTR.
  160.  
  161. Once this routine has stored the invocation name, subsequent calls merely 
  162. return, doing nothing.  Repeated calls via the GO command will not change 
  163. the original invocation name.
  164.  
  165. IMPORTANT NOTE: This routine requires a linker search of Z3LIB after the 
  166. search of ZSLIB.
  167.