Find a string -- reverse
From CometWiki
(Difference between revisions)
(New page: '''DOS pseudo functions: Find a string -- reverse''' '''Syntax:''' DOSMS(AX-value, BX-value, CX-value, DX-value) EXCP=statement-label '''Entry:''' AX = "@FFFB@" ...) |
|||
(3 intermediate revisions not shown) | |||
Line 11: | Line 11: | ||
non-0 value means that a beginning-of-file was encountered | non-0 value means that a beginning-of-file was encountered | ||
before the specified number of occurrences were found. | before the specified number of occurrences were found. | ||
- | + | . | |
- | + | BX = file handle | |
- | + | CX = number of occurrences to find (in hex) | |
- | + | DX = the search string | |
- | '''Discussion:''' | + | '''Discussion:'''<br> |
This pseudo function searches an entire file for a specified string in reverse record order (physical order). <br> | This pseudo function searches an entire file for a specified string in reverse record order (physical order). <br> | ||
If the string is found anywhere within the file, the file pointer is positioned at the physical record where the string was found. <br> | If the string is found anywhere within the file, the file pointer is positioned at the physical record where the string was found. <br> | ||
The search starts at current position in the file. | The search starts at current position in the file. |
Latest revision as of 11:49, 13 June 2009
DOS pseudo functions: Find a string -- reverse
Syntax:
DOSMS(AX-value, BX-value, CX-value, DX-value) EXCP=statement-label
Entry:
AX = "@FFFB@" . Upon execution of the DOSMS function, the AX register acts as a "countdown" field. If the number of occurrences of the search string is found, the value in this register is 0. A non-0 value means that a beginning-of-file was encountered before the specified number of occurrences were found. . BX = file handle CX = number of occurrences to find (in hex) DX = the search string
Discussion:
This pseudo function searches an entire file for a specified string in reverse record order (physical order).
If the string is found anywhere within the file, the file pointer is positioned at the physical record where the string was found.
The search starts at current position in the file.