forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The mysterious *

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Wed Mar 22, 2023 1:48 am    Post subject: The mysterious * Reply with quote

Does simply * mean standard input respectively output?
Back to top
View user's profile Send private message Send e-mail
mecej4



Joined: 31 Oct 2006
Posts: 1840

PostPosted: Wed Mar 22, 2023 2:22 am    Post subject: Reply with quote

Depends on the context. You often seem to assume that we are able to see the lines of code that you ask about without showing those lines.

When used in place of an I/O unit number, what you wrote is correct.

However, it also stands for the multiplication operator, a pair as the exponentiation operator, and so on.
Back to top
View user's profile Send private message
Zach



Joined: 13 Mar 2023
Posts: 85
Location: Groningen, Netherlands

PostPosted: Wed Mar 22, 2023 3:12 pm    Post subject: Reply with quote

If in any context a sign or character could have so many different meanings, that one could not possibly say what it could potentially mean, then asking the question what it means, by giving examples, would be impossible. I also see :: being required in particular declaration statements, but when I leave those signs out, I get no error message. So I fear that asking what :: means would be soliciting you for the same kind of response.
Back to top
View user's profile Send private message Send e-mail
wahorger



Joined: 13 Oct 2014
Posts: 1154
Location: Morrison, CO, USA

PostPosted: Wed Mar 22, 2023 9:48 pm    Post subject: Reply with quote

The language element of :: in a declaration is a way to allow additional parameters to be applied to the declaration. For some parameters, this is the only way I know of to add them. However, for simplicity, here's a few examples of equivalent declarations.

Code:
C --- Define an integer function
INTEGER ABCD_DEFG
EXTERNAL ABCD_DEFG

C --- Define a 100 element array of type=integer
INTEGER AN_ARRAY
DIMENSION AN_ARRAY(100)

C --- Define an integer variable that can be used like a constant
INTEGER A_PARM
PARAMETER (A_PARM = 1234)


Code:

INTEGER,EXTERNAL:: ABCD_DEFG

INTEGER AN_ARRAY(100)  or
INTEGER:: AN_ARRAY(100)

INTEGER,PARAMETER:: A_PARM=1234


Unlike many languages, FORTRAN has ALWAYS had ways to declare variables using multiple lines to do that which can now be done on a single line. For me, I prefer the single line. So, I use a lot of :: kinds of declarations, yet still have (in 40 year old code) some using the older syntax and on single lines.

There is a lot of syntactical understanding that is required to write decent code (whether it be FORTRAN or any other language). Experimenting is good, and PLATO with FTN95 is a good place to start your learning.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group