CALLB - call a B function from a Fortran 66 routine.

Alternate Entry Name: .CALLB

Usage:

external bfunc
integer callb
...
i = callb(bfunc, arg1, arg2, ...)

Where:

bfunc
is the name of a B function.
arg1, arg2, ...
are arguments to be passed to the B function.

Description:

CALLB will call the B routine "bfunc" with arguments "arg1", "arg2", etc.

When Fortran 66 calls a routine, it always does so by passing pointers to the actual arguments. Thus the B function which is called must indirect through the pointers it receives in order to get the actual values. For example, "*(arg1)" would give the contents of the first argument passed by the Fortran program.

The value returned by CALLB is the result of "bfunc". If "bfunc" does not return a value, the "integer" declaration may be omitted and CALLB may be invoked as a subroutine via the Fortran "call" statement.

Any Fortran program using CALLB must be loaded using the B run-time library or else the stack will not be properly constucted to handle the B function.

See Also:

expl b fortran
for a general discussion about Fortran within a B environment.
expl b lib callc
for a similar routine to call a C or Pascal routine from Fortran.
expl b lib callf
for how to call a Fortran routine from B, C or Pascal.
expl b lib callff
for how to call a Fortran REAL function from B.

Copyright © 1996, Thinkage Ltd.