GetLastReturn

Description

Returns the return value from the last InvokePBFunction or TriggerPBEvent function.

Applies to

Window ActiveX controls

Syntax

activexcontrol.GetLastReturn ( )

Argument

Description

activexcontrol

Identifier for the instance of the PowerBuilder window ActiveX control. When used in HTML, the ActiveX control is the NAME attribute of the object element. When used in other environments, this references the control that contains the PowerBuilder window ActiveX.


Return value

Any.

Returns the last return value.

Usage

Call this function after calling InvokePBFunction or TriggerPBEvent to access the return value. JavaScript scripts must use this function to access return values from InvokePBFunction and TriggerPBEvent. VBScript scripts can either use this function or access the return value using an argument in InvokePBFunction or TriggerPBEvent.

Examples

This JavaScript example calls the GetLastReturn function:

...
    retcd = PBRX1.TriggerPBEvent(theEvent, numargs);
    rc = parseInt(PBRX1.GetLastReturn());
if (rc != 1) {
    alert("Error. Empty string.");
    }
...

This VBScript example calls the GetLastReturn function:

...
    retcd = PBRX1.TriggerPBEvent(theEvent, & 
    numargs, args)
    rc = PBRX1.GetLastReturn()
    IF rc <> 1 THEN
    msgbox "Error. Empty string."
    END IF
...

See also

GetArgElement

InvokePBFunction

SetArgElement

TriggerPBEvent