PDA

View Full Version : Z'hex' with implied DO statement


travis
09-11-2003, 12:06 AM
I'm porting some unix (Apogee) fortran code to Lahey. I have a data initializer that uses an implied DO statement within a DATA declaration. Why can't I use a hexadecimal value for this declaration?

Example:
DATA (TUPOP(K),K=Z'11',Z'1A')/'IAM ','GSM ','GRQ ','ACM ',
& 'SEC ','ANC ','RLG ','MGB ','? ',
& 'ACC '/

Travis Jones

tzeis
09-11-2003, 10:06 PM
It could be that your Unix compiler is allowing an extension.
Strictly speaking, these constants are only allowed in a data statement in a context where they are being assigned to a variable. As an extension, many compilers allow them to appear in a simple assignment statement, like
i = z'1a'
if there are no other operations occurring on the right side of the "="
I have never seen them allowed in a context where they are loop indices.
Since they are constants, your best bet is to convert them to their integer equivalents.