- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My code uses "Console" mode, and the program uses drag and drop to obtain the input data file name. A program user would drag the data file to the program or shortcut icon, the program would open in a console window, and the file name would be entered by pressing the "enter" key. Users could also type in the file name and enter the name.
Versions of the program compiled on the old computer work as expected on the new computer, and the drag and drop functioning normally. I have recomplied the program with the new computer and new version of fortran but the drag and drop are no longer working. In fact, it is not possible to type in the file information in the window. I can code in the name and the program does work as expected.
The compile and link log form the old computercontained the following
**********************************************************
************************************************************
To test what is happening I created the following code:
***********************************
PROGRAM intest
USE IFPORT
CHARACTER*80 FNAME, NEWNAME
FNAME='PROMPT'
WRITE(*,2000)
2000 FORMAT(/,5X,'test1')
IF (FNAME.EQ.'PROMPT') THEN
WRITE (*,'(1X,A\)') 'Enter FILENAME for INPUT data: '
write (*,*)'point 1 - before fname entry'
READ (*,'(A)') NEWNAME
write (*,'(A)') NEWNAME
write (*,*)'point 2 - after fname entry'
END IF
WRITE (*,'(1X,A\)') 'Enter FILENAME for INPUT data: '
write (*,*)'point 3 - before fname entry'
READ (*,'(A)') NEWNAME
write (*,'(A)') NEWNAME
write (*,*)'point 4 - after fname entry'
WRITE (*,*) 'End of test'
call Sleep(15)
STOP
END
***********************************************The log for the new short file on the new computer has the following:
***********************************
I have tried to match the configuration properties of the new short program with the previous version, and I should be able to use the read command to enter a file name using drag and drop, or enter data from the keyboard.
I have noticed that I can enter keyboard data to the read when the fpscomp:general command is not set (Other Powerstation runtime behavior).
When I set this switch even keyboard entry is not received. In no case have I been able to get the drag and drop to work.
Is there something else I should be checking? Should I try to go back to the earlier compiler version? Is there some other procedure I should be using in place of the procedure I now use?
Thanks for any assistance.
Cliff Anderson
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
Thank you for your response. I look forward to your input.
One thing I noticed was that there were no "Loop was vectorized" or "block was vectorized" warnings when I recompiled the code on the new computer. They were there whit the previous compile version, but I am not sure what i ded to generate them. This is seems to be releared to compiler parallel processing, and I dont know if I need it on or off.
It may not make any difference for my drag and drop problem but I thought I would alert you.
I look forward to your guidance, because I am at a loss on how to proceed.
Cliff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your test program does not properly use the drag-and-drop feature. The way drag-and-drop works is that the full path to the file you "dropped" is added as an argument to the command line for the executable. If you compile with /fpscomp:filesfromcmd and open a unit with FILE='', then the file path will be read from the command argument if there, otherwise you'll get an "open file" dialog where you can browse for the file.
There's nothing in that feature that would somehow supply the dropped file name in a READ.
Here's a short example:
[plain]character(80) line open (unit=1,file='',status='old',form='formatted') do read (1,'(A)',END=99) line print *, trim(line) end do 99 close(1) accept * end [/plain]
Build this with /fpscomp:filesfromcmd and then drag a text file onto the EXE - it will "print" it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My functional program did have an open command that was very similar to the example that you posted. I should have realized where the drag and drop function was occurring. With the guidance you provided I was able to get the drag and drop to work with my computer running in Windows 7.
One thing I did notice is that draging files with path names longer than 80 characters would not work properly. However, if the program was first opened, then I could drag files with longer path names to the open window, and get the path name data into the open command. I needed to do some error message checking and looping to get it to work, but I can now get path names of about 160 characters into the open command using drag and drop. For path names longer than 80 characters, the program must be opened first. I use an error message to the consoleif a path name longer than 80characters is detected.
I suspect that I will need to go to a quick windows setup, or something similar, to geteverything to work exactlythe way I would like it to. For now, the console application works as expected.
The compiler switches on the compiler compatibility mode for PowerStation compability were still giving me problems when I set the switch to "Use other PowerStation runtime behavior" (FPScomp:general). Fortran carriage control was being set in previous versions of Visual Fortran and thedrag and drop would work. When I set this switch in the latest version, the drag and drop would quit working. I found analternativecompiler switch in the RunTime configuration. I set the "Default output carriage control" to FORTRAN (ccdefault:fortran) and this set the carriage control so it was compatible with PowerStation and the drag and drop continued to function properly.
The compatibility FPScomp switches "filesfromcmd" "ioformat" "ldio_spacing" and "logicals" all work as expected.
In summary: My "old" Fortran Powerstation program is now running on 64-bit Windows 7.
Cliff

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