2.1.12 Exit


Description

Exit Origin.

Syntax

VB: Function Exit As Boolean
C++: bool Exit
C#: bool Exit

Return

A boolean value with true indicating Origin exited and false indicating it did not exit.

Remark

Examples

VBA

Private Sub ExitOrigin()
    Dim bExit As Boolean
    bExit = True

    If app.IsModified Then
        If MsgBox("Project is modified." & vbNewLine & "Do you still want to exit?", vbYesNo) = vbNo Then
            bExit = False
        End If
    End If

    If bExit Then
        bExit = app.Exit
    End If

    If bExit Then
         MsgBox ("Origin exited")
    Else
         MsgBox ("Origin is still running")
    End If
End Sub

C#

using Origin; // allow using Exit without having to write Origin.Exit

static void ExitOrigin()
{
    bool bExit = true;

    ApplicationSI app = new Origin.ApplicationSI();
    if (app.IsModified)
    {
        Console.WriteLine("Project modified.\nDo you still want to exit? (Y/N)");

        ConsoleKeyInfo keyInfo;
        keyInfo = Console.ReadKey();
        if (keyInfo.KeyChar != 'Y' && keyInfo.KeyChar != 'y')
            bExit = false;
    }

    if (bExit)
        bExit = app.Exit();

    if (bExit)
        Console.WriteLine("Origin Exited");
    else
        Console.WriteLine("Origin is still running");
    Console.ReadKey();
}

Python

import OriginExt as O
app = O.Application(); app.Visible = app.MAINWND_SHOW
app.Exit()

Version Information

8.0SR2

See Also