Lgi Scripting Library

These are the built in methods for the Lgi scripting language:
String handling:
Strchr
Strstr
Strcmp
Substr
LoadString
FormatSize
Sprintf
Tokenize
Containers/Objects:
NewHashTable
NewList
DeleteElement
New
Delete
Files:
ReadTextFile
WriteTextFile
SelectFiles
ListFiles
DeleteFile
Time:
Sleep
ClockTick
Now
General:
Execute
GetInputDlg

string Strchr(str, ch[, len]);

Finds a unicode character in a string.

Arguments:
Returns:

string Strstr(str1, str2[, case_insensitive[, len]]);

Finds a string in another string.

Arguments:
Returns:

int Strcmp(str1, str2[, case_insensitive[, len]]);

Compares 2 strings.

Arguments:
Returns:

string Substr(str, start[, len]);

Returns a part of another string.

Arguments:
Returns:

string LoadString(id);

Loads a string from the resource file.

Arguments:
Returns:

string FormatSize(bytes);

Formats a number of bytes in KB, MB or GB as appropriate.

Arguments:
Returns:

string Sprintf(format[, args, ...]);

Formats a string.

Arguments:
Returns:

list Tokenize(string, delimiter);

Splits a string up into segments according to the delimiter specified.

Arguments:
Returns:

hashtable NewHashTable();

Returns an empty hash table object.

Arguments:
Returns:
See also this page on container type handling.

list NewList();

Returns an empty list object.

Arguments:
Returns:
See also this page on container type handling.

bool DeleteElement(container, index);

Returns an empty list object.

Arguments:
Returns:

object New(object);

Creates a custom object.

Arguments:
Returns:

void Delete(object);

Deletes a custom object.

Arguments:
Returns:

string ReadTextFile(filename);

Returns the contents of a text file.

Arguments:
Returns:

bool WriteTextFile(filename, data);

Writes the contents of a variable to a text file.

Arguments:
Returns:

list SelectFiles(parent_wnd[, file_types[, initial_dir[, multi_select]]]);

Shows a file select dialog.

Arguments:
Returns:

list ListFiles(folder_path[, pattern]);

Lists files in a folder.

Arguments:
Returns:

bool DeleteFile(path);

Deletes a file.

Arguments:
Returns:

void Sleep(ms);

Pauses the current thread.

Arguments:
Returns:

int64 ClockTick();

Returns the current clock tick.

Arguments:
Returns:

int64 Now();

Returns the current date time.

Arguments:
Returns:

string Execute(executable, arguments);

Executes a process.

Arguments:
Returns:

string GetInputDlg(parent_wnd, initial_value, msg, title, is_password);

Asks the user for input using a dialog.

Arguments:
Returns: