11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CALL<br />

Syntax<br />

CALL *sub.name [[(argument1[,argument2][MAT array1 [,MAT array2]]...)]<br />

[ASYNC | SYNC] [ON connection]<br />

CALL @var [[(argument1[,argument2][MAT array1 [,MAT array2]]...)]<br />

[ASYNC | SYNC] [ON connection]<br />

CALL sub.name [[(argument1[,argument2][MAT array1 [,MAT array2]]...)]<br />

[ASYNC | SYNC] [ON connection]<br />

Description<br />

The <strong>UniBasic</strong> CALL command transfers program control to an external subroutine.<br />

The first form of the syntax calls a globally cataloged subroutine.<br />

The second form of the syntax calls a subroutine named in a variable.<br />

The third form of the syntax calls a subroutine directly.<br />

The called program or subroutine must contain a RETURN statement, which returns<br />

control to the calling program or subroutine.<br />

You can nest subroutines up to 1,024 levels deep.<br />

Note: You must catalog subroutines before using them in a <strong>UniBasic</strong> CALL statement.<br />

You must separate individual arguments by commas and enclose the set of arguments<br />

within parentheses. You can place arguments on multiple lines. Each continued line<br />

must end with a comma. Regardless of placement, the number and type of arguments<br />

in the CALL statement must match the number and type of arguments in the<br />

SUBROUTINE statement within the external subroutine. Arrays and singlevalued<br />

arguments can be passed in the same CALL statement.<br />

Tip: You can also pass variables through named and unnamed common areas.<br />

Variables stored in common area(s) are accessible to both calling and called<br />

programs without being passed as arguments. You cannot use the same variable<br />

name in both a SUBROUTINE argument and a common variables list.<br />

CALL 1-120

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

Saved successfully!

Ooh no, something went wrong!