Top Navigational Bar

Advance Macro Commands {IF} And {SYSTEM} Used
DocumentID: 651015
Revision Date: 29-Feb-96 8:29:03 PM

The information in this document applies to:
WordPerfect® 5.1 for DOS

Problem

Solutions: The advance macro commands {IF} and {SYSTEM} can be used to determine if a directory in List Files is empty. Look at the example and keep in mind that an empty directory still has 2 files, CURRENT and PARENT.
      {IF}{SYSTEM}list~=2~

A practical application for this string would be when wanting to create a macro which would retrieve all of the files in a directory and then stop when the directory was empty.

NOTE: This macro is designed to delete the files in the directory as it retrieves them. MAKE SURE TO HAVE YOUR CUSTOMER MAKE A BACKUP OF ALL THE FILES ON A FLOPPY OR OTHERWISE.

Here's the macro:

      {List}{Enter}{Down}1
      {LABEL}loop~
      {LIST}{LIST}
      {IF}{SYSTEM}list~=2~
      {PROMPT}All files are appended; Press F7 twice to exit~
      {QUIT}{ELSE}2y1y
      {END IF}
      {GO}loop~

The macro simply lists the files in the directory from which one would like to retrieve the documents, moves down one, and chooses 1 to retrieve the first document in the list. Notice the first two commands in the LABEL called loop are {List}{List}. Pressing F5 twice will take the user back into the list on the last file that was retrieved. It then keeps going through 2 to delete, Y for yes, 1 to retrieve the next file and Y for yes to retrieve into current document.

The process continues until it meets the IF statement. SYSTEM list checks to see how many files are in a particular list. The prompt just tells the user when the macro is complete.

Answer:

Details:


Product specifications, packaging, technical support and information (*Specifications*) refer to theUnited States retail English version only. Specifications for other versions may vary. All Specifications, claims, features, representations, and/or comparisons provided are correct to the best of our knowledge of the date of publication, but are subject to change without notice.OUR MAXIMUM AGGREGATE LIABILITY TO YOU AND THAT OF OUR DEALERS AND SUPPLIERS IS LIMITED. IT SHALL NOTEXCEED THE AMOUNT YOU PAID TO ACCESS THE INFORMATION. SEE LEGAL DISCLAIMER.