>>-RXQUEUE--+-----------+--+--------+--------------------------><
+-queuename-+ +-/FIFO--+
+-/LIFO--+
+-/CLEAR-+
Example 18.2. Command RXQUEUE
/* Sample program to show simple use of RXQUEUE */ /* Find out the Windows version number, using the */ /* VER command. VER produces two lines of */ /* output; one blank line, and one line with the*/ /* format "The Windows Version is n.nn" */ "VER |RXQUEUE" /* Put the data on the Queue */ pull . /* Get and discard the blank line */ Pull . "VERSION" number "]" /* The bracket is required for Windows 95, not for Windows NT */ Say "We are running on Windows Version" number
Example 18.3. Command RXQUEUE
/* Sample program to show how to use the RXQUEUE filter */
/* This program filters the output from a DIR command, */
/* ignoring small files. It displays a list of the */
/* large files, and the total of the sizes of the large */
/* files. */
size_limit = 10000 /* The dividing line */
/* between large and small*/
size_total = 0 /* Sum of large file sizes*/
NUMERIC DIGITS 12 /* Set up to handle very */
/* large numbers */
/* Create a new queue so that this program cannot */
/* interfere with data placed on the queue by another */
/* program. */
queue_name = rxqueue("Create")
Call rxqueue "Set", queue_name
"DIR /N | RXQUEUE" queue_name
/* DIR output starts with five header lines */
Do 5
Pull . /* discard header line */
End
/* Now all the lines are file or directory lines, */
/* except for one at the end. */
Do queued() - 1 /* loop for lines we want */
Parse Pull . . size . name ./* get one name and size */
/* If the size field says "<DIR>", we ignore this */
/* line. */
If size <> "<DIR>" Then
/* Now check size, and display */
If size > size_limit Then Do
Say format(size,12) name
size_total = size_total + size
End
End
Say "The total size of those files is" size_total
/* Now we are done with the queue. We delete it, which */
/* discards the line remaining in it. */
Call rxqueue "DELETE", queue_name