- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a problem with passed parameters
On arriving at a called routine I find that values are nothing like what was originally set
The code looks like this....
CHARACTER*1 SCRAMBLED*20, KEY_SITEFILE*20
INTEGER(4) OUT_DATE(3)
LOGICAL*4 ERR
SCRAMBLED = 'ONJIAOLZ537 '
KEY_SITEFILE = 'GabitesPorter '
OUTDATE = 0
ERR = .FALSE.
CALL DECODEDATE(SCRAMBLED, KEY_SITEFILE, OUT_DATE, ERR)
But when we get there...
SUBROUTINE DECODEDATE(IN_KEY, IN_CRYPT, OUT_DATE, ERR)
CHARACTER*1 IN_KEY*20, IN_CRYPT*20
INTEGER(4) OUT_DATE(3)
LOGICAL*4 ERR
We find that...
IN_KEY = 'O '
IN_CRYPT = ' '
OUT_DATE(1) = Undefined address
OUT_DATE(2) = Undefined address
OUT_DATE(3) = Undefined address
ERR = .TRUE.
Both pieces of code reside in the same file
Any ideas what might cause this?
Thankx for your help
Jim
Desperate in Christchurch
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code "looks like" that or "is" that? If I work up a complete example based on what you showed, I get different behavior. I will note that you declare OUT_DATE but assign to OUTDATE.
Which compiler and version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
The code "looks like" that or "is" that? If I work up a complete example based on what you showed, I get different behavior. I will note that you declare OUT_DATE but assign to OUTDATE.
Which compiler and version are you using?
I have since found that setting iface/:CVF sorted the problem
Thankx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jim.cox
The code looks like this....
CHARACTER*1 SCRAMBLED*20, KEY_SITEFILE*20
Why do you use character*1 and then scrambled*20?
When you look at the first parameter of your routine, it also has only one character. Doesnt look like clean coding, using some compiler options to get rid of itis not the way to go...
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That use of *1 and *20 is legal, but confusing.
If /iface:CVF sorted the problem, then what you showed us was not representative of the actual code or organization.
If /iface:CVF sorted the problem, then what you showed us was not representative of the actual code or organization.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - onkelhotte
Why do you use character*1 and then scrambled*20?
When you look at the first parameter of your routine, it also has only one character. Doesnt look like clean coding, using some compiler options to get rid of itis not the way to go...
Markus
Agreed
It is nasty 20 year old code
And moving to the Intel compiler is uncovering a whole heap of "issues"
At least I now have a build that runs (sort of) and is debug-able

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page