Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28456 Discussions

character initialization using hexadecimal

LRaim
New Contributor I
261 Views

The following specification is accepted by the compiler:

      CHARACTER*1 FALSE/Z'00'/, TRUE/Z'01'/

but is not accepted in the next case:

CHARACTER(LEN=1), PARAMETER :: FALSE=Z'00', TRUE=Z'01'

 v9synchk.for(102): error #6957: This is an illegal data type value for this parameter.   [Z'00']
      CHARACTER(LEN=1), PARAMETER :: FALSE=Z'00', TRUE=Z'01'

 

 

0 Kudos
1 Reply
Steven_L_Intel1
Employee
261 Views

Well, those are two very different declarations. BOZ constants (Binary, Octal, Hexadecimal) are allowed in DATA statements. Your first declaration uses a non-standard syntax that is treated like DATA. The second is declaring a named constant and here a BOZ constant isn't allowed in that context. Try CHAR(Z'00') and CHAR(Z'01') instead.

0 Kudos
Reply