ReturnValue (Command)

Description

Sets or returns a Boolean value indicating whether the handler function returns a value (true) or not (false). If set to false, Softimage assumes there is no return value, regardless of whether or not the implementation actually tries to return a value.

If set to true, which is the default, Softimage tries to return a value. If the command does not actually return anything an empty Variant is returned.

C# Syntax

    // get accessor
    Boolean rtn = Command.ReturnValue;

    // set accessor
    Command.ReturnValue = Boolean;

Examples

VBScript Example

    'First command has no return value
    'and is implemented as a vbscript "sub"
    set cmd = Application.CreateCommand("NoReturnValue")
    cmd.ScriptingName = "NoReturnValue"
    cmd.Handler = "Foo"
    cmd.Code = _
       "sub Foo() " & vbCrLf & _
       "   Logmessage ""NoReturnValue called"" " & vbCrLf & _
       "end sub"
    cmd.Language = "VBScript"
    cmd.ReturnValue = false
    Application.AddCommand cmd

    'The second command does return the value 56
    'and is implemented as a vbscript "function"
    set cmd = Application.CreateCommand("ReturnValue")
    cmd.ScriptingName = "ReturnValue"
    cmd.Handler = "Foo"
    cmd.Code = _
       "function Foo() " & vbCrLf & _
       "   Foo = 56" & vbCrLf & _
       "end function"

    cmd.Language = "VBScript"
    cmd.ReturnValue = true
    Application.AddCommand cmd

    ' Call our new commands
    NoReturnValue
    LogMessage( ReturnValue )

    'Cleanup
    Application.RemoveCommand( "NoReturnValue" )
    Application.RemoveCommand( "ReturnValue" )

    'The following results will be logged
    'INFO : NoReturnValue called
    'INFO : 56

Autodesk Softimage v7.5