![]() ![]() In my view, simple tricks like this should be introduced in the very beginning of a Fortran VF tutorial book. This helped me out since I can check values of variables in Fortran the old-fashioned way - the VF debugger tends to crash, while I can run the program (at least partially.). PRINT *, "The value of variable VAR is: ", VAR Somewhere before you want to print data, call the AllocConsole function: INTEGER B ! needs to run a boolean AllocConsole function to open USE DFWIN ! loads routines from the Digital Fortran Win32 API Place the following declarations/commands in the declaration part of the main program/some subroutine that is called before you want to print to the console window: ![]() Here is a somewhat more complete description of the solution: Thanks to Steve L, who set me on the right track. #Simply fortran debugging how to#to close the windows manually!!!)įinally - I'm not versed in the Visual Studio environment - I only know it through using Visual Fortran a few hours (and I have not been able to find tutorial material on how to use it I am aware of the Digital Visual Fortran Programmer's Guide, but I don't consider that a tutorial). If you could help me, please also inform me how I close the windows/output channels, and how I can do this after I have read the message. So - I just need a *simple* way so that I can print some standard text strings and values of variables (integers, double precision, double precision arrays) to a console type window. When I click "OK" in this window, Visual Basic crashes and stops. ![]() #Simply fortran debugging code#When I run the code in debug mode from Visual Basic and select the option that should work and then closes the GUI (whereupon the Fortran code is run), the program crashes with an error message window with title: "Visual Fortran run-time error". If I do this and build the project, there are no error messages. Q: How can I print variable values to a console-like window from VF? To get around this problem, I want to insert PRINT/WRITE statements in the Fortran code which prints information to a console-like window when I run the code in debug mode from Visual Basic.Īfter this lengthy introduction, I've come to the question. Thus, I'm not able to take advantage of the VF debugger. When I select to run the appropriate case in the simulation program and try to open the GUI, an error message comes up, and I have to close the simulation program. If I do this, the simulation program is started. I have also set the system up so that I can run Visual Fortran in debug mode. If I in the GUI choose to use the new code I have developed, and close the GUI (whereupon Fortran is run), something gets wrong - no answer is found (probably due to logic errors in the Fortran code). When I make a selection in the GUI (in VB) such that the old dummy Fortran code is called, everything seems to work as before. (A parameter is passed on to the Fortran program, and the selection is performed in Fortran.) In my GUI, I can select which Fortran routines to call. (The GUI is written in VB.) When I insert certain information in the GUI and closes this, the Fortran part is called on to do the calculations. This starts up the simulation program, and I open the GUI of a process unit in the simulation program. ![]() I try to run the code by running VB in debug mode. This compiles and is linked with zero errors and zero warnings. I have now tried to finish the real Fortran project/workspace (or whatever). Previously, I have written a dummy Fortran routine, and this works with VB/simulation program. The VB code interacts with a commercial simulation program. I'm developing a Fortran program which is called from Visual Basic. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |