Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell command causes end of file error

Status
Not open for further replies.

bcbvi

Programmer
Sep 26, 2011
3
DE
I have a VB project which prints lines of data to a text file:

Dim textline As String
FileOpen(1, Application.StartupPath & "\ouputtextfile.txt", OpenMode.Output)
textline = "T" & Environment.NewLine & "1"
Print(1, textline)
FileClose(1)

I then run an executable which was compiled from fortran code:

Shell(Application.StartupPath & "\f95code.exe", AppWinStyle.NormalFocus, True)

This executable starts off by reading from the text file.
The debugger compains about the .f95 code: 'attempt to read past end of file at line xx'
where xx is the line number of the 1st read statement in the f95 code.
This sounds like I should be posting on a fortran forum but...

When I run the same compiled .exe rather than calling from the shell command the f95 code works fine.

How can calling .exe from the shell command affect the way it runs?!

Help would be Hugely appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top