摘要
针对FORTRAN语言计算效率高而图形功能弱 ,VisualBasic(VB)计算效率低而图形功能强的特点 ,采用VB和FORTRAN 2种语言混合编程 ,充分利用各自的优点 ,实现FORTRAN计算程序资源的再利用 .此外 ,探讨了 2种实现FORTRAN计算程序可视化的方法 :一是通过磁盘文件在VB程序和FORTRAN程序间交换数据 ,并借助WindowsAPI(应用程序编程接口 )函数实现FORTRAN外壳程序在VB中同步运行 ,使FORTRAN外壳程序的计算结果在VB图形界面上显示 ;二是将FORTRAN程序转化为动态链接库函数 ,通过函数参数传递使VB程序和FORTRAN动态链接库函数之间交换数据 ,将FORTRAN的计算结果在VB窗体上显示并进行作图处理 ,从而实现了FORTRAN计算程序的图形界面及计算结果的可视化 .
In the light of the characteristics that Calculating efficiency of FORTRAN language is high but its graphic function of it is weak and the contrary characteristics of Visual Basic (VB) is low but its graphic function of it is powerful, the author programmed with mixed languages of VB and FORTRAN, so that their advantage can be utilized adeqately, and the purpose of reusing resources of FORTRAN calculation program was realized. Two methods of realizing graph interface of FORTRAN calculation programs were explored. One of them is exchanging data between VB program and FORTRAN program by disk files, drawing support from Windows API functions to realize FORTRAN shell program run in VB in synchronism, and showing calculating results of FORTRAN shell program on VB form. The other method is to change FORTRAN program into Dynamic Link Library (DLL) functions, exchange data between VB program and FORTRAN program by transmitting parameters of functions, show calculating results of FORTRAN DLL functions on VB form and draw graphs for these results. Thus the graph interface of FORTRAN calculation program is added and the results of calculation are visualized. Some techniques of programming with mixed language are discussed in this paper. [
出处
《中南工业大学学报》
CSCD
北大核心
2000年第6期561-564,共4页
Journal of Central South University of Technology(Natural Science)