Chapter Contents

Previous

Next
Command Directory

return

Return Immediately from a Function

ABBREVIATION
ret{urn}

FORMATS

Format 1: return

Format 2: return
[SCALAR-TYPE-EXPRESSION]
Format 3: return
AGGREGATE-TYPE-EXPRESSION | {VALUE-LIST}

DESCRIPTION
The return command performs an immediate return from a function without executing any further code in the function. Return values are supplied by the arguments.

The return command can be issued from any hook. However, additional debugger requests that are in effect at the normal return from the function, are processed only if the return command is issued from a line hook.

Format 1: This format is used for functions that return void or int . In the case of functions that return integers, the value in register 15 is returned.

Format 2: This format is used for functions that return a nonbitfield scalar. Except for functions that return an integer, you must always supply the SCALAR-TYPE-EXPRESSION argument if the function returns a scalar. See SCALAR-TYPE-EXPRESSION Argument for additional information.

Format 3: This format is used for functions that return an AGGREGATE-TYPE-EXPRESSION. An aggregate expression has a type of structure or union. See AGGREGATE-TYPE-EXPRESSION Argument for additional information.

The VALUE-LIST argument is used to supply a list of values that is returned to the calling function's structure or union. The VALUE-LIST argument contains any or all of the following items, enclosed by braces:

The values supplied with a return command are assigned to the receiving structure or union in the same manner as they are with the assign command. See Rules for assigning VALUE-LISTs to aggregate objects in assign.

EXAMPLES

return
returns from a calling function that returns either a void or an integer . If the return type is integer , the value in register 15 is returned.

return ptr
returns the pointer ptr to the calling function.

return my_struc
returns the structure my_struc to the calling function.

return {1,2,'A'}
returns a VALUE-LIST argument of {1,2,'A'} to the calling function.

SYSTEM DEPENDENCIES
none

SCOPE
The return command is not affected by changes in scope.

COMMAND CAN BE ISSUED FROM

PROFILE no
configuration file no
Source window prefix none

RETURN CODES SET
Successful: 0
Unsuccessful: 1

SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.