INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

problem on format

problem on format

(OP)
Hi everyone,

I'm new here, so if I'm doing something wrong just tell me.
I have a problem with a format in my program.

This is the format:
995 format(5x,10herro:vi=,i12,7h,10x,7hihist=,i8)


The error says this:
995 format(5x,10herro:vi=,i12,7h,10x,7hihist=,i8)
1
Error: Unexpected element ',' in format string at (1)


If anyone can help me, I'd be very greatful.

Thank you,

Kom4tsu

RE: problem on format

(OP)
The "1" is below "i12,7h"

RE: problem on format

Where exactly under the "i12,7h"? Next time, use CODE tags, please.

I am thinking the comma came too soon as you said your Hollerith constant was going to be 10 characters long (10h)...not that Hollerith constants cannot take commas, but you took it away from the i12 format.

Or, 7h is not quite accepted either? Maybe just use "7x" ?

But all this is besides the point, please stop using Hollerith constants; instead, use regular string constants:

CODE

995 format(5x,"erro:vi= ",i12,7x,10x,"ihist= ",i8) 

RE: problem on format

Should really use ' instead of ". " didn't become standard until F90. If Hollerith constants exist, then it is probably F77.

The part that doesn't make sense is the 7x,10x - why not just 17x? I'm guessing that it was copied without spaces. Could it mean

CODE

995   format(5x, 'erro:vi= ', i12,',',10x,'ihist=',i8) 

RE: problem on format

That's fine, use single quotes, then. As far as the 7x followed by 10x...that was just me not wanting to merge a couple of format fields (7h,10x) the OP had in the first place...the less I change things, the better the OP can go from his code to the proposed one.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close