Programming with Reflection

image\rwnprg32.gif WaitForPrinterStringReplace method


Syntax object.WaitForPrinterStringReplace String, Timeout, Column



Begins a wait that is satisfied by the appearance of a specified search string, which may be replaced by a replacement string. The procedure is paused until the wait is satisfied or expires.

Note that both the search and replace text are substrings of the String argument. The Column argument is used to mark the beginning of the replacement string. For example, the following statement will replace all instances of "Mary Smith" with "Joe Jones." If "Mary Smith" is not sent to the printer, the wait will expire after three minutes and an error will occur.

Session.WaitForPrinterStringReplace "Mary SmithJoe Jones", "00:03:00", 11

You can remove a character or set of characters from printed output by setting the value of the Column argument to 1. For example, this statement will remove all instances of "XYZ":

Session.WaitForPrinterStringReplace "XYZ", "00:03:00", 1


String Argument type: String
The first portion of this argument specifies the string that will terminate the wait. The second portion specifies the replacement string. Use Column to specify the first character of the replacement string.

Timeout Argument type: String
Specifies an interval of time in HH:MM:SS format. If this interval elapses before the specified event occurs, an error occurs.

Column Argument Type: Integer
Specifies the starting location of the replacement string in the String argument. (Double-byte characters each occupy two positions).

Set Column to 1 if you want to filter out the specified text. In this case the specified String is replaced by a null string.

If the value of Column is greater than the length of the String, no change is made to the printed output.



image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command