UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

RETURN Syntax RETURN [TO label[:]] Description The UniBasic RETURN command transfers program control from a subroutine back to the calling program or subroutine. The optional TO clause returns to a statement label. This clause is valid only for internal subroutine returns. If you do not specify a TO clause, control passes to the statement immediately following the GOSUB or CALL statement in the calling program or subroutine. Example The following externally cataloged subroutine is called by the sample program in Appendix A, “Sample Program,” of Developing UniBasic Applications. The RETURN statement returns control to UPDATE_ORDERS. 1-688 UniBasic Commands Reference SUBROUTINE DISPLAY_MESSAGE(MESSAGE) DISPLAY @(5,20):MESSAGE DISPLAY @(5,21):"Press the (Return) key.": INPUT PAUSE,1_ RETURN Related Commands UniBasic CALL, GOSUB, ON/GOSUB

REUSE Syntax REUSE(dyn.array.expr) Description The UniBasic REUSE function affects the application of arithmetic operations on dynamic arrays. When REUSE Is Not Used When you execute an arithmetic operation on an array and you do not include the REUSE function, one of the following happens: Array and constant – When you apply an arithmetic operation to an array and a constant, the operation is executed against only the first element of the array. If you want the operation to execute on every element in the array, apply REUSE to the constant. Two arrays – When you execute an arithmetic operation on arrays of different lengths, the operation is performed on the number of elements in the shortest array only. The remaining elements are each filled with 1 or 0, depending on the operation performed: Division – 1. Addition, subtraction, and multiplication – 0. If you apply REUSE to the shorter array, the last element in this array is used to perform the operation on the remaining elements in the longer array. REUSE 1-689

REUSE<br />

Syntax<br />

REUSE(dyn.array.expr)<br />

Description<br />

The <strong>UniBasic</strong> REUSE function affects the application of arithmetic operations on<br />

dynamic arrays.<br />

When REUSE Is Not Used<br />

When you execute an arithmetic operation on an array and you do not include the<br />

REUSE function, one of the following happens:<br />

Array and constant – When you apply an arithmetic operation to an array<br />

and a constant, the operation is executed against only the first element of the<br />

array. If you want the operation to execute on every element in the array,<br />

apply REUSE to the constant.<br />

Two arrays – When you execute an arithmetic operation on arrays of<br />

different lengths, the operation is performed on the number of elements in<br />

the shortest array only. The remaining elements are each filled with 1 or 0,<br />

depending on the operation performed:<br />

Division – 1.<br />

Addition, subtraction, and multiplication – 0.<br />

If you apply REUSE to the shorter array, the last element in this array is used<br />

to perform the operation on the remaining elements in the longer array.<br />

REUSE 1-689

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

Saved successfully!

Ooh no, something went wrong!