2.1.11 Execute


Description

The Execute method executes a LabTalk script in specified context.

Syntax

VB: Function Execute(script As ByVal String, [ Name As ByVal Object ] ) As Boolean
C++: bool Execute(LPCSTR script, _variant_t Name )
C#: bool Execute(string script, var Name )

Parameters

script
LabTalk script to execute.
Name
--

Return

Remark

Examples

VBA

'Assumes Graph1 exists and contains axis
'Setting x axis scale:
Dim oApp As Origin.ApplicationSI
Dim bb As Boolean
Set oApp = GetObject("", "Origin.ApplicationSI")
bb = oApp.Execute("X1=0;X2=10","Graph1")

C#

static void Main(string[] args)
{
    Origin.IOApplication pOrigin;
    pOrigin = new Origin.ApplicationSIClass();
    //set X axis scale
    if (pOrigin.Execute("X1=0;X2=20", "Graph1"))
        System.Console.WriteLine("Set graph scale successfully!");

}

Python

import OriginExt as O
app = O.Application(); app.Visible = app.MAINWND_SHOW
grPageName = app.CreatePage(app.OPT_GRAPH)
app.Execute("x1=5;x2=27", grPageName)

Version Information

8.0SR2

See Also