Hi,
I have a small problem understanding the following peace of code. It should be very simple but for me, coming from a visual basic background, it doesn't make sense.
The variable "R" is passed trough from a preceding peace of code.
So here are my questions:
Is the expression "IFRAC" considered a variable or something else since it hasn't been declared and for my understanding it is not included in the general declaration of "IMPLICIT REAL*8(A-H, O-Z)"...
Then:
Isn't the code processed from top to bottom?
If so, how much sense does it make to set "IFRAC" equal to "R" and then RETURN if "IFRAC" is equal to "R" (rows 3 vs. 5)?
Thanks for your help!
Tobias
I have a small problem understanding the following peace of code. It should be very simple but for me, coming from a visual basic background, it doesn't make sense.
Code:
FUNCTION IFRAC(R)
IMPLICIT REAL*8(A-H, O-Z)
IFRAC=R
IF (R.GE.0) RETURN
IF (R.EQ.IFRAC) RETURN
IFRAC = IFRAC - 1
RETURN
END
The variable "R" is passed trough from a preceding peace of code.
So here are my questions:
Is the expression "IFRAC" considered a variable or something else since it hasn't been declared and for my understanding it is not included in the general declaration of "IMPLICIT REAL*8(A-H, O-Z)"...
Then:
Isn't the code processed from top to bottom?
If so, how much sense does it make to set "IFRAC" equal to "R" and then RETURN if "IFRAC" is equal to "R" (rows 3 vs. 5)?
Thanks for your help!
Tobias