Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How long can a statement be?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dick Hendrickson  
View profile  
 More options Mar 6 2000, 3:00 am
Newsgroups: comp.lang.fortran
From: Dick Hendrickson <dick.hendrick...@att.net>
Date: 2000/03/06
Subject: Re: How long can a statement be?
A line can be up to 132 characters.  In the F90 fixed form lines are
continued by using an & character at the end of the line and optionally
at the start of the next line.  Character constants require the & at the
start of the next line (so the compiler knows whether or not leading
blanks are significant.)

So, you could do yours as:
 PRINT *,'---------------------------------------------------&
     &------------------------------------------------------------&
&---------------------------------------------------------------------'

As a matter of style I like to use concatination for continuing
characters.  Something like:

 PRINT *,'---------------------------------------------------'//   &
 '------------------------------------------------------------'//  &
'---------------------------------------------------------------------'
because the rules for where the & must go and what to do about leading
blanks and trailing comments seem easier to me.

For your specific example, something like
    print '(150a)', ('-', i = 1,100)  
might be better.  It's more compact, and it's obvious that you will
get 100 dasheson the output line.

Dick Hendrickson

Sami SIDHOUM wrote:

> Hi All,

>  I am using f90 to compile my fortran codes. It seems to me that if a
> statement line is too long, it generates errors. Is this true? How can I
> write a line of code on two lines?

>  To illustrate what I mean, here is a line that seems to sisplease f90:
> PRINT *,'---------------------------------------------------
> ------------------------------------------------------------
> ---------------------------------------------------------------------'
> (all on one line of course)

>  Thanks for your help.
>  Sami.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.