- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And here's the Fortran implementation of FILETEST. DATADIR is fine; OUTDIR and FTSTATUS are the two with "Undefined address."
SUBROUTINE FILETEST (DATADIR, OUTDIR, FTSTATUS) USE DFPORT USE DFLIB CHARACTER*100, INTENT(IN) :: DATADIR CHARACTER*100, INTENT(INOUT) :: OUTDIR INTEGER, INTENT(INOUT) :: FTSTATUS CHARACTER*100 :: cwd, cwd1, command INTEGER :: istat, istat2 istat = GETCWD(cwd1) istat = CHANGEDIRQQ(DATADIR) istat = GETCWD(cwd) OPEN (unit=17, file='fjksd.txt', iostat=istat, status='unknown') if (istat.eq.0) then OUTDIR = TRIM(DATADIR) // CHAR(0) close (17) istat2 = DELFILESQQ('fjksd.txt') FTSTATUS = istat go to 119 else if (istat.gt.0) then FTSTATUS = istat close (17) CALL PROMPT_OUTDIR(OUTDIR) OUTDIR = TRIM(OUTDIR) // CHAR(0) endif 119 istat = CHANGEDIRQQ(cwd1) RETURN END SUBROUTINE FILETEST
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you defined OUTDIR and FTSTATUS prior to calling FILETEST - if not then they will be undefined.
Incidently looking at your code I can't see why you set INTENT to INOUT for these arguments, OUT looks to be more appropriate and may well avoid the issue as then you will then not expect a value for either variable on routine entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, OUTDIR and FTSTATUS are initialized in the C++ main portion, just as DATADIR is.
I'll try setting INTENT(OUT) and see if that helps -- I thought I had already tried that but my memory may be failing me.
Thanks.

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