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.

SUBROUTINE<br />

Syntax<br />

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

Description<br />

The <strong>UniBasic</strong> SUBROUTINE command determines the beginning of an external<br />

subroutine.<br />

The SUBROUTINE statement must be the first noncomment line in a subroutine.<br />

You can specify arguments to pass data between the main program and the<br />

subroutine. If you pass arguments, the number of arguments in the CALL statement<br />

and the SUBROUTINE statement must match, although variable names do not need<br />

to be the same. Changes made to arguments in the subroutine retain their new values<br />

when UniData exits the subroutine and control reverts to the calling program.<br />

When calling a subroutine from UniData ODBC, the subroutine name cannot contain<br />

any special characters.<br />

Note: All subroutines must be cataloged using the ECL CATALOG command before<br />

being called. For more information about the CATALOG command, see the UniData<br />

<strong>Commands</strong> <strong>Reference</strong>.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

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

Parameter Description<br />

sub.name Specifies the subroutine name.<br />

(argument1 ,argument2 ...) Specifies arguments to pass to the subroutine. The<br />

arguments can be simple variables, dynamic arrays, or<br />

dimensioned arrays.<br />

SUBROUTINE Parameters

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

Saved successfully!

Ooh no, something went wrong!