Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

fpscomp read with drag-drop

cliffct
Beginner
830 Views
I am using code originally created with MS Powerstation. It has been compiled and running on Intel Fortran 11.0.066. I recently had to quit using my old computer because of a hardware problem and now have the program running on Intel Visual Fortran 11.1.051 [IA-32] running under Visual Studio 2008. The new computer is a 64-bit running Windows 7.

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

**********************************************************
Compiling with Intel Fortran 11.0.066 [IA-32]... ifort /nologo /fpscomp:filesfromcmd /fpscomp:ioformat /fpscomp:ldio_spacing /fpscomp:general /module:"Release\" /object:"Release\" /libs:static /threads /c /Qvc9 /Qlocation,link,"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin" "C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR" C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(182): (col. 7) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(199): (col. 7) remark: PARTIAL LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1002): (col. 14) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1144): (col. 9) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1179): (col. 7) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1184): (col. 7) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1479): (col. 10) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1728): (col. 7) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1741): (col. 7) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1757): (col. 13) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(1761): (col. 13) remark: LOOP WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(769): (col. 7) remark: BLOCK WAS VECTORIZED. C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\AHYMOwin.FOR(716): (col. 7) remark: LOOP WAS VECTORIZED. Linking... Link /OUT:"Release\AHYMO-S4-R1.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\Console1\release\ahymo-s4-r1.exe.intermediate.manifest" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\Console1\release\ahymo-s4-r1.lib" "Release\AHYMCwin.obj" "Release\AHYMGwin.obj" "Release\AHYMEwin.obj" "Release\AHYMBwin.obj" "Release\AHYMAwin.obj" "Release\AHYMFwin.obj" "Release\AHYMDwin.obj" "Release\AHYMOwin.obj" Link: executing 'link' Embedding manifest... mt.exe /nologo /outputresource:"C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\Console1\release\ahymo-s4-r1.exe;#1" /manifest "C:\Users\Cliff Anderson\Documents\Visual Studio 2008\Projects\AHYMO-S4_Rel1\AHYMO-S4\Console1\release\ahymo-s4-r1.exe.intermediate.manifest" AHYMO-S4-R1 - 0 error(s), 0 warning(s)

************************************************************


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:

Deleting intermediate files and output files for project 'test3', configuration 'Release|Win32'. Compiling with Intel Visual Fortran 11.1.051 [IA-32]... ifort /nologo /fpscomp:filesfromcmd /fpscomp:ioformat /fpscomp:ldio_spacing /fpscomp:general /module:"Release\" /object:"Release\" /libs:static /threads /4Yportlib /c /Qvc9 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" "C:\Users\Cliff\Documents\Visual Studio 2008\Projects\IO-Test2\IO-Test2\IO_Test1.for" Linking... Link /OUT:"Release\test3.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"C:\Users\Cliff\Documents\Visual Studio 2008\Projects\test3\test3\Release\test3.exe.intermediate.manifest" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Users\Cliff\Documents\Visual Studio 2008\Projects\test3\test3\Release\test3.lib" "Release\IO_Test1.obj" Link: executing 'link' Embedding manifest... mt.exe /nologo /outputresource:"C:\Users\Cliff\Documents\Visual Studio 2008\Projects\test3\test3\Release\test3.exe;#1" /manifest "C:\Users\Cliff\Documents\Visual Studio 2008\Projects\test3\test3\Release\test3.exe.intermediate.manifest" test3 - 0 error(s), 0 warning(s)

***********************************
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





0 Kudos
4 Replies
Steven_L_Intel1
Employee
830 Views
Let me check into this and I'll get back to you.
0 Kudos
cliffct
Beginner
830 Views
Quoting - cliffct

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


0 Kudos
Steven_L_Intel1
Employee
830 Views
Optimization reports are off by default in version 11.1. You can enable them if you want.

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.
0 Kudos
cliffct
Beginner
830 Views

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

0 Kudos
Reply