24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

-qctyplss Option<br />

Syntax<br />

-qctyplss[(=[no]arg)] | -qnoctyplss<br />

CTYPLSS[([NO]ARG)]| NOCTYPLSS<br />

Specifies whether character constant expressions are allowed wherever typeless<br />

constants may be used. This language extension might be needed when you are<br />

porting programs from other plat<strong>for</strong>ms.<br />

Arguments<br />

arg | noarg<br />

Suboptions retain the behavior of -qctyplss. Additionally, arg<br />

specifies that Hollerith constants used as actual arguments will be<br />

treated as integer actual arguments.<br />

Rules<br />

With -qctyplss, character constant expressions are treated as if they were Hollerith<br />

constants and thus can be used in logical and arithmetic expressions.<br />

Restrictions<br />

v If you specify the -qctyplss option and use a character-constant expression with<br />

the %VAL argument-list keyword, a distinction is made between Hollerith<br />

constants and character constants: character constants are placed in the<br />

rightmost byte of the register and padded on the left with zeros, while Hollerith<br />

constants are placed in the leftmost byte and padded on the right with blanks.<br />

All of the other %VAL rules apply.<br />

v<br />

The option does not apply to character expressions that involve a constant array<br />

or subobject of a constant array at any point.<br />

Examples<br />

Example 1: In the following example, the compiler option -qctyplss allows the use<br />

of a character constant expression.<br />

@PROCESS CTYPLSS<br />

INTEGER I,J<br />

INTEGER, PARAMETER :: K(1) = (/97/)<br />

CHARACTER, PARAMETER :: C(1) = (/’A’/)<br />

I = 4HABCD<br />

J = ’ABCD’<br />

! Hollerith constant<br />

! I and J have the same bit representation<br />

! These calls are to routines in other languages.<br />

CALL SUB(%VAL(’A’)) ! Equivalent to CALL SUB(97)<br />

CALL SUB(%VAL(1HA)) ! Equivalent to CALL SUB(1627389952)"<br />

! These statements are not allowed because of the constant-array<br />

! restriction.<br />

! I = C // C<br />

! I = C(1)<br />

! I = CHAR(K(1))<br />

END<br />

144 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!