2.1.25 LTStr


Description

The LTStr property provides access to LabTalk string variables.


Syntax

VB: Property Get/Let LTStr(Name As ByVal String ) As String
C++: LPCSTR LTStr(LPCSTR Name )
C#: string LTStr(string Name )
Python: def GetLTStr(self, Name)

Parameters

Name
--

Remark

Examples

VBA

Dim oApp As Origin.ApplicationSI
Dim str As String
Set oApp = GetObject("", "Origin.ApplicationSI")
str = "Test"
oApp.LTStr("ABC$") = str
str = oApp.LTStr("ABC$")

C#

        public void LTStr()
        {
            Origin.IOApplication pOrigin;
            Origin.GraphLayer gl;

            pOrigin = new Origin.ApplicationSIClass();
            pOrigin.Visible = MAINWND_VISIBLE.MAINWND_SHOW;

            //%Y is the labtalk string register to hold the current user file folder path
            //%G is the current project file name
            //use MessageBox class, you need to import System.Windows.Forms;
            MessageBox.Show(pOrigin.get_LTStr("%Y") + pOrigin.get_LTStr("%G"), "Current project name");

        }
        static void Main(string[] args)
        {
            Program p = new Program();
            p.LTStr();
        }

Python

import OriginExt as O
app = O.Application(); app.Visible = app.MAINWND_SHOW
app.PutLTStr("TestStr", "TestStrValue")
print(app.GetLTStr("TestStr"))

Version Information

8.0SR2


See Also

LTVar