Silverfrost Forums

Welcome to our forums

The mysterious *

22 Mar 2023 12:48 #30069

Does simply * mean standard input respectively output?

22 Mar 2023 1:22 #30070

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.

22 Mar 2023 2:12 #30073

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.

22 Mar 2023 8:48 #30076

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.

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)




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.

Please login to reply.