Extended LabTalk Commands


Math

NAG functions cannot (in general) be directly called from LabTalk. However, a large number of NAG special functions have been wrapped in Origin C making them available to be called from LabTalk. See the source file LT_math.c in the \OriginC\OriginLab subfolder of Origin for implementation details. To list all NAG special functions wrapped in Origin C (and available to be called from LabTalk) execute the List_NAG_SF function in the Script window.


Project Explorer


pe_cd

Change the current Project Explorer path. Both absolute ("/a/b") and relative ("../b") pathing is

supported. When an absolute path is used the project name can be omitted (e.g. "/" returns to

the root folder).

void pe_cd(string strPathName)

Example:

pe_cd(".."); // Move out of current folder (up one level)

pe_cd("myDir"); // Move into a subfolder named myDir

pe_cd("../myDir"); // Move out of the current folder (up one level) and into a folder named myDir

pe_cd("/"); // Move into the root folder

Parameters:

strPathName=Absolute or relative path of the folder to move into

Return:

No return value.

See Also:

pe_mkdir, pe_rmdir


pe_dir

List all pages and folders matching the specified window name and type.

void pe_dir(string strPageName = "", string strPageType = "")

Example:

pe_dir(); // Gives a list of all subfolders and pages

pe_dir("*"); // Gives a list of all pages

pe_dir("*", "w"); // Gives a list of all pages of type w or wks

pe_dir("", "p"); // Gives a list of all pages of type p or graph

Parameters:

strPageName=Name of the page ("*" matches all pages)

strPageType=Type of the page ("w" is worksheet, "p" or "g" is graph, "m" is matrix,

"n" is note, "l" is layout, "*" matches all pages)

Return:

No return value.


pe_get_path

Get the path of the folder where the specified page is located.

string pe_get_path(string strPageName)

Example:

a$ = pe_get_path("myPage")$; // Get the path of a page named myPage

Parameters:

strPageName=Name of the page to be searched for

Return:

If the page is found a string containing the path of the page is returned otherwise a

null string is returned and an error message is printed.


pe_mkdir

Create a new subfolder.

void pe_mkdir(string strSubfolderName)

Example:

pe_mkdir("myDir"); // A new subfolder named myDir is created

Parameters:

strSubfolderName=Name of the new folder to be created. If the folder name already exists it will be enumerated.

Return:

No return value.


pe_rename

Rename a page or subfolder.

void pe_rename(string strOldName, string strNewName)

Example:

pe_rename("myPage", "myPage1"); // Rename a page named myPage to myPage1

Parameters:

strOldName=Name of an existing page

strNewName=New name of page

Return:

No return value.


pe_rmdir

Remove or delete a folder.

void pe_rmdir(string strSubfolderName, BOOL bFolderPrompt = FALSE, BOOL bPagePrompt = FALSE)

Example:

pe_rmdir("myDir"); // A folder named myDir is deleted without prompt

Parameters:

strSubfolderName=Name of the folder to be deleted

bFolderPrompt=If TRUE Origin will prompt the user to verify before deleting the folder

bPagePrompt=If TRUE Origin will prompt the user to verify before deleting the page

Return:

No return value.


pe_search_page

Recursively search through the folders of a project for a specified page.

int pe_search_page(string strPageName)

Example:

int ii = pe_search_page("myPage"); // Search for a page named myPage

Parameters:

strPageName=Name of the page to search for

Return:

Returns 1 if the page is found and 0 otherwise.


Worksheet


pg_dump_header

Dump the header lines stored in the worksheet page during an ASCII import.

void pg_dump_header(int nOutput = 0)

Example:

pg_dump_header 1;

Parameters:

nOutput=Output location (i.e. where to dump the header lines), 0 for new notes window, 1 for script window

Return:

No return value.

See Also:

pg_get_header


pg_get_header

Get the header lines stored in the worksheet page during an ASCII import.

string pg_get_header()

Example:

// Get the string into the LabTalk variable header$. Note the $ suffix

// at the end of the command is needed to place the value of the

// string returned by the function into the LabTalk variable.

header$=pg_get_header()$;

Parameters:

None.

Return:

A string containing the header contents.

See Also:

pg_dump_header


pg_get_info_str

Get the string value of a specified information storage variable.

string pg_get_info_str(string strVarName)

Example:

// Get the string into the LabTalk variable var$. Note the $ suffix

// at the end of the command is needed to place the value of the

// string returned by the function into the LabTalk string variable.

var$=pg_get_info_str("L1V1")$;

Parameters:

strVarName=Name of the information storage variable in page.info.user.variables section

Return:

The string value of the specified variable.

See Also:

pg_get_info_val


pg_get_info_val

Get the real value of a specified information storage variable.

double pg_get_info_val(string strVarName)

Example:

// Get the value of the variable L1V1 into the LabTalk variable myval.

myval = pg_get_info_val("L1V1");

Parameters:

strVarName=Name of the information storage variable in page.info.user.variables section

Return:

A double equal to the value of the specified variable.

See Also:

pg_get_info_str