Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this a hex constant? 1

Status
Not open for further replies.

jamez05

Programmer
Jul 29, 2005
130
US
The following variables are declared as bytes:
Code:
byte ch, scratch(120)

later on in the code, a variable is set to 1h:
Code:
if (len.lt.120)scratch(len+1)=1h

1h is not a declared variable, so I'm assuming its hex.

Later, the following code appears:
Code:
if (1h1.le.ch.and.ch.le.1h9)

I'm not sure how to interpret that. Any insight is appreaciated.
 
I've never seen Hollerith characters used like this but I suppose it is legal in F77.
Code:
if (len.lt.120)scratch(len+1)=1h
if (len.lt.120)scratch(len+1)=' '

if (1h1 .le. ch .and. ch .le. 1h9) 
if ('1' .le. ch .and. ch .le. '9')
 
Thanks again xwb. I looked up Hollerith characters and was able to figure out what's going on.

Boy is some of this code strange:
Code:
if (ch.EQ.1H-)
 
I've never seen that either.

Good idea though.

I've seen programs with embedded control characters and it's quite tricky to edit...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top