|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Fri Jun 16, 2023 4:06 pm Post subject: Spockian illogicality |
|
|
Here's a little demonstrator:
Code: |
PROGRAM TEST
LOGICAL LABSON, LEGON
LABSON = .TRUE.
LEGON = .TRUE.
write(*,*) LABSON, LEGON
write(*,*) LABSON .AND. LEGON
END |
As might be expected, the output is T T on one line, and T on the next.
But, in my 4000+ line program that I wrote over 30 years ago, two consecutive write statements give me T T and then F, with the F thereby failing an IF statement on the next line.
Now, I cannot recall what on earth possessed me to use LOGICAL variables in the first place, as I almost never do (and swear that I'll never do again). Instead I think I'll go back to testing for 0 and 1 in an INTEGER.
Just 32 bit mode, and doesn't need a fix, as I'll never use LOGICAL ever again!
Dan's devilry no doubt.
Eddie |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1225 Location: Morrison, CO, USA
|
Posted: Fri Jun 16, 2023 11:30 pm Post subject: |
|
|
I have had irreproducible issues when logicals were in COMMON and EQUIVALENCED. Especially if the logicals defaulted to LOGICAL*2 in one context and LOGICAL*4 in another context.
It was long ago, and the fix escapes me.
I wish I had documented my situation and posted it here. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8016 Location: Salford, UK
|
Posted: Sat Jun 17, 2023 6:28 am Post subject: |
|
|
Eddie
Thanks for the feedback. Some issues can be difficult to track down. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Sun Jun 18, 2023 5:21 pm Post subject: |
|
|
Aye, and especially difficult as it works in one place, and not in another! |
|
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
|