FIX: SELECT on Characters Greater Than ASCII 127 Fails (86715)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q86715 SYMPTOMS
Code compiled that contains a SELECT CASE block which compares a CHARACTER
test expression against a case which is higher than 127 in the ASCII table
may produce incorrect results.
CAUSE
When the compiler generates the code for the comparison of the CHARACTER
test expression against the high ASCII constant it produces an incorrect
comparison against a negative number which will always fail.
RESOLUTION
When comparing against ASCII values greater than 128, use integers for the
comparison and convert the test expression from CHARACTER to INTEGER using
the ICHAR intrinsic function.
STATUS
Microsoft has confirmed this to be a problem in FORTRAN version 5.1. This
problem was corrected in FORTRAN PowerStation, version 1.0.
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | kbfix KB86715 |
---|
|