Top Navigational Bar

{CASE CALL} Truncates Leading Zeros Entered A
DocumentID: 601406
Revision Date: 29-Feb-96 1:28:40 PM

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

Problem

Symptoms: A macro that uses the {TEXT} command and has a {CASE CALL} to branch to different labels fails if the numbers entered are preceded by zeros. The following macro will not branch to label 030 if 030 is entered at the {TEXT} command:
      {TEXT}1~Which one do you want? ~
      {CASE CALL}{VAR 1}~030~030~~
      {QUIT}
      {LABEL}030~ This is 030 {RETURN} Solutions: The number entered as 030 is interpreted as 30 when used in the {CASE CALL} statement. In fact the preceding macro will allow you to enter 030, 0030, 00030, 000030, 0000000000000000000000000030, etc. and still work because the number is always 30 when used in the {CASE CALL} statement. If you treat the number as a string, the following macro will work if 030 is entered:
      {TEXT}1~Which one do you want? ~
      {CASE CALL}"{VAR 1}"~"030"~030~~
      {QUIT}
      {LABEL}030~ This is 030 {RETURN}

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.