Top Navigational Bar

Macro-{WHILE} Loop Executes Correctly Until C
DocumentID: 652873
Revision Date: 29-Feb-96 8:29:19 PM

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

Problem

Symptoms: The {WHILE} loop in the macro T.WPM will run perfectly until the condition is not met and then the macro just stops, instead of going on and selecting the Italic font code. Solutions: The expression in the {WHILE} loop assumed that the {SYSTEM}right~ will always return a number rather then a "string" (meaning a character). When the expression landed on the space that was at the end of the file, the {SYSTEM}right~ returned a string value of a space. Whenever a user has an expression in a macro that evaluates a string value, each side of the comparison statement has to be surrounded by quotes. Since the expression did not have the surrounding quotes, the expression handler returned an error condition because it could not properly evaluate the expression. The {SYSTEM}right~ shouldn't be blindly used in expression statements. The value return from the {SYSTEM}right~ should always be tested first to make sure that the expression is testing for strings or numbers. Appendix J in the WordPerfect manual explains more fully about expressions.

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.