- Home
- User Articles
- How To Write ZEMAX Extensions in FORTRAN
- Home
- Programming ZEMAX
- Extensions
- How To Write ZEMAX Extensions in FORTRAN
How To Write ZEMAX Extensions in FORTRAN
- By Anthony Richards
- Published 22 June 2006
- User Articles , Extensions
-
Rating:




FORTRAN Coding Requirements 2
Controlling the calling interface from C to FORTRAN
There is only one function involved here, and that is the USERFUNCTION, which is called by the ZCLIENT C-code from within the main window procedure, WndProc. This function should start in the following way:

‘STRING’ has been defined as 260 characters long in the C-code (where it is given the name ‘szCommandLine’), so that value is used here. It is passed by reference, hence this attribute is applied to it. Note how ALIAS is used again, to ensure that ‘_USERFUNCTION’ is looked for by the linker.
There is only one function involved here, and that is the USERFUNCTION, which is called by the ZCLIENT C-code from within the main window procedure, WndProc. This function should start in the following way:

‘STRING’ has been defined as 260 characters long in the C-code (where it is given the name ‘szCommandLine’), so that value is used here. It is passed by reference, hence this attribute is applied to it. Note how ALIAS is used again, to ensure that ‘_USERFUNCTION’ is looked for by the linker.