Wednesday, October 6, 2010

Delphi and mixed programming language FORTRAN


As we all know, FORTRAN stronger than numerical calculation, especially if the evaluations conducted for the complex, then the FORTRAN more incomparable advantages. FORTRAN is the only all languages will be complex data types defined as a standard language.

But the FORTRAN programming language in the visual aspect is very lacking, at least not yet launched a company with RAD features of the FORTRAN compiler integrated development environment.

Therefore, when using FORTRAN implementation of a future large-scale scientific computing, such calculations are difficult to input data into simple, easy WINDOWS results visualization applications. This is very easy with Delphi. Thus, in many cases, the use of FORTRAN and Delphi programming can be both a mixture of both advantages.

In this paper, two different methods to achieve hybrid programming. One is the direct implementation of the executable file the way, one is called Dynamic Link Library subroutines way. In the first mode, the Delphi programming in the implementation of direct implementation of the FORTRAN program file by file for data exchange;

In the second case, the first FORTRAN program compiled dynamic link library (DLL), the Delphi programming, call this a dynamic link library routines to accomplish a calculation. Both methods have their advantages and disadvantages.

The first method of debugging a relatively simple, does not exist between the different language data type mismatch. However, under this approach, 鍦?Delphi can not achieve the effective supervision of the program is running, the same time, to file for data exchange in Caozuo not in Ye convenience, inefficient.

The second approach integrates the difference between the two proceedings, if preparation of the success of the program is running can not see traces of mixed-language programming, but particularly troublesome in this way to debug them. In general, the existing input and output more complex FORTRAN program, consider the first approach, and for relatively simple, or their own procedures for the preparation of new, can choose the second.

1. Implementation of the executable file (exe) mode

Windows provides API functions to perform the existence WinExec implementation file. The function is defined as:

UINT WinExec (LPCSTR lpCmdLine, UINT uCmdShow);

Parameters as follows:
LPCSTR lpCmdLine: contains the implementation of the command line.

The system will find application in the following areas:
鈶?application start position
鈶?the current directory location
鈶?Windows system directory
鈶?Windows directory
鈶?path set path list
UINT uCmdShow: defines how the form to start the process of constant value. Specified as follows:
SW_HIDE hide the window, to make a window active
SW_MINIMIZE minimize the window to make a window active
SW_RESTORE with the original size and location to display a window at the same time make it into the active
SW_SHOW with the current size and location to display a window at the same time make it into the active
SW_SHOWMAXIMIZED maximize the window, and its activation
SW_SHOWMINIMIZED minimize windows, and its activation
SW_SHOWMINNOACTIVE minimize a window, without changing the active window
SW_SHOWNA with the current size and location to display a window, does not change the active window
SW_SHOWNOACTIVATE with recent size and position of a window display, while not changing the active window
SW_SHOWNORMAL and SW_RESTORE same

If Str is a record of the executable file path and file name variable, WinExec (Pchar (Str), SW_SHOWNORMAL) that in normal circumstances the implementation of the executable file.





相关链接:



My favorite Audio And Multimedia



SA118 Chinese Translation 2



Recommend Covert Surveillance



Urgent situation of 3G intellectual property rights on how long the operator toddler



Sina's brilliant and Bleak: 5 CEO change



ie closes when OPENING fixing tip



Tencent Said The Prosecution Did Not Rule Out The Possibility 51.com



Log ANALYSERS Specialist



SWsoft VIRTUOZZO: maverick chaser



Dong Jie: Datang International Power Pathfinder Line



Easy Gallery And Cataloging Tools



XviD to MP4



MKV to Zune



M2TS To MKV



Longhorn Beta1 Only Compatible With Two Kinds Of Graphics Chips



No comments:

Post a Comment