|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Wed Mar 22, 2023 1:48 am Post subject: The mysterious * |
|
|
Does simply * mean standard input respectively output? |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Wed Mar 22, 2023 2:22 am Post subject: |
|
|
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 |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Wed Mar 22, 2023 3:12 pm Post subject: |
|
|
If in any context a sign or character could have s�o 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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Wed Mar 22, 2023 9:48 pm Post subject: |
|
|
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 |
|
|
|
|
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
|