11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CALLC<br />

Syntax<br />

CALLC c.sub.name [(argument1[,argument2]...)]<br />

CALLC @var [(argument1[,argument2]...)]<br />

Description<br />

The <strong>UniBasic</strong> CALLC command transfers program control to an external function<br />

(c.sub.name). The second form of the syntax calls a function whose name is stored in<br />

a <strong>UniBasic</strong> variable (@var). The program could pass back return values in variables.<br />

CALLC arguments can be simple variables or complex expressions, but not arrays.<br />

CALLC can be used as a command or function.<br />

Calling a C Program in UNIX<br />

You must link the C program to UniData before calling it from a <strong>UniBasic</strong> program.<br />

Perform the following procedure to prepare UniData for CALLC:<br />

1-123 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

1. Write and compile the C program.<br />

2. Define the C program call interface.<br />

3. Build the runtime version of UniData (containing the linked C program).<br />

4. Write, compile, and execute the <strong>UniBasic</strong> program.<br />

For more information about this procedure, see Developing <strong>UniBasic</strong> Applications.<br />

Calling a Function on Windows Platforms<br />

The CALLC implementation in UniData for Windows Platforms uses the Microsoft<br />

Windows Dynamic Link Library (DLL) facility. This facility allows separate pieces<br />

of code to call one another without being permanently bound together. Linking<br />

between the separate pieces is accomplished at runtime (rather than compile time)<br />

through a DLL interface.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!