return

The return statement ends a subroutine.


Parameters

No parameters.


Description

The return statement may be used to end a subroutine at any point. When this statement is encountered Panorama stops the current procedure. If the current procedure was called as a subroutine by another procedure, Panorama returns to the previous procedure (hence the name of the statement). Panorama then continues from the point just after the call, farcall, shortcall or execute statement that started the procedure. If the current procedure was not called as a subroutine, it simply stops (see the stop statement).

Note: In previous versions of Panorama the return statement was called the rtn statement. You may use either or both of these spellings.

This example subroutine adjusts the inventory level if there is enough in stock to complete the order. Otherwise the subroutine simply returns to the original procedure that called it.

if OnHand < parameter(1)
    return
endif
OnHand=OnHand-parameter(1)

Notice that this procedure does not have a return statement at the end. However, Panorama will always automatically return when it reaches the end of a procedure. You can include a return statement at the end if you like, but it is not necessary and makes no difference to the operation of the subroutine.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.