Miscellaneous

Function

Description

uCommandLine

Returns the command line string of the current process

uGetEnv

Returns the value of an environment variable

uGuid

Returns a global unique identifier

uMD5

Generates a checksum over a given string

uScriptLoad

Loads and evaluates JavaScript and returns the result

uSetEnv

Sets the value of an environment variable

uSetLocale

Changes the locale date and time settings to a different language

uSleep

Suspends the process for a specified number of milliseconds

uSystemFolder

Returns predefined application and system paths




uCommandLine

Description

Returns the command line string of the current process

Syntax

string uCommandLine()

Examples

Example 1

uCommandLine() // returns 
"GridNode.exe --port 5124"

NoteuCommandLine is not supported on UNIX.




uGetEnv

Description

Returns the value of an environment variable

Syntax

string uGetEnv(variable)

Parameters

string variable

Name of the environment variable to read

Examples

Example 1

uGetEnv("LOAD_MAX_VALUE")



uGuid

Description

Returns a global unique identifier in one of these formats:

Syntax

string uGuid([format])

Parameters

string format (optional)

Format for the GUID value to be returned

Examples

Example 1

uGuid() // returns for example A8A10D9F-963F-4914-8D6FC8527A50EF2A



uMD5

Description

Generates a checksum over a given string with a fixed length of 32 characters

Syntax

string uMD5(text)

Parameters

string text

Text to build a checksum on

Examples

Example 1

uMD5("Austin Powers") // returns "C679A893E3DA2CC0741AC7F527B1D4EB"



uScriptLoad

Description

Loads and evaluates JavaScript and returns the result

Syntax

string uScriptLoad(filelocation)

Parameters

string filelocation

The JavaScript file to load.

Examples

Example 1

Load an external JavaScript file:

uScriptLoad("\\server3\myScripts\basicFunctions.js")



uSetEnv

Description

Set the value of an environment variable

Syntax

string uSetEnv(variable, value)

Parameters

string variable

Name of the environment variable to set

string value

Value to set

Examples

Example 1

uSetEnv("LOAD_MAX_VALUE", IN.Date)



uSetLocale

Description

Changes the locale date and time settings to a different language

Syntax

string uSetLocale([language] [, country] [, codepage])

Parameters

string language (optional)

Language string to be used (see table in Usage section)

string country (optional)

Country name to be used (see table in Usage section)

string codepage (optional)

Code page number as string

Examples

Example 1

Retrieve month names in different languages:

locale:uSetLocale("english")    // switch to english
uMonthName("2005-03-22") // returns "March"
uSetLocale("german")     // switch to german
uMonthName("2005-03-22") // returns "Marz"
uSetLocale("C")          // switch back to OS default

Usage


Language Strings

The language strings in the table below are recognized. Any language not supported by the operating system is not accepted by uSetLocale.

NoteThe three-letter language-string codes are valid only in Windows NT and Windows 95.

Primary language

Sublanguage

Language string

Chinese

Chinese

"chinese"

Chinese

Chinese (simplified)

"chinese-simplified" or "chs"

Chinese

Chinese (traditional)

"chinese-traditional" or "cht"

Czech

Czech

"csy" or "czech"

Danish

Danish

"dan"or "danish"

Dutch

Dutch (Belgian)

"belgian", "dutch-belgian",or "nlb"

Dutch

Dutch (default)

"dutch" or "nld"

English

English (Australian)

"australian", "ena", or "english-aus"

English

English (Canadian)

"canadian", "enc", or "english-can"

English

English (default)

"english"

English

English (New Zealand)

"english-nz" or "enz"

English

English (UK)

"eng", "english-uk", or "uk"

English

English (USA)

english", "americanenglish", "english-american", "english-us", "english-usa", "enu", "us", or "usa"

Finnish

Finnish

"fin" or "finnish"

French

French (Belgian)

"frb" or "french-belgian"

French

French (Canadian)

"frc" or "frenchcanadian"

French

French (default)

"fra"or "french"

French

French (Swiss)

"french-swiss" or "frs"

German

German (Austrian)

"dea" or "germanaustrian"

German

German (default)

"deu" or "german"

German

German (Swiss)

"des", "german-swiss", or "swiss"

Greek

Greek

"ell" or "greek"

Hungarian

Hungarian

"hun" or "hungarian"

Icelandic

Icelandic

"icelandic" or "isl"

Italian

Italian (default)

"ita" or "italian"

Italian

Italian (Swiss)

"italian-swiss" or "its"

Japanese

Japanese

"japanese" or "jpn"

Korean

Korean

"kor" or "korean"

Norwegian

Norwegian (Bokmal)

"nor" or "norwegianbokmal"

Norwegian

Norwegian (default)

"norwegian"

Norwegian

Norwegian (Nynorsk)

"non" or "norwegiannynorsk"

Polish

Polish

"plk" or "polish"

Portuguese

Portuguese (Brazil)

"portuguese-brazilian" or "ptb"

Portuguese

Portuguese (default)

"portuguese" or "ptg"

Russian

Russian (default)

"rus" or "russian"

Slovak

Slovak

"sky" or "slovak"

Spanish

Spanish (default)

"esp" or "spanish"

Spanish

Spanish (Mexican)

"esm" or "spanish-mexican"

Spanish

Spanish (Modern)

"esn" or "spanish-modern"

Swedish

Swedish

"sve" or "swedish"

Turkish

Turkish

"trk" or "turkish"


Country or Region Strings

The following is a list of country/regions strings recognized by uSetLocale. Strings for countries/regions that are not supported by the operating system are not accepted by uSetLocale. Three-letter country or region codes are from ISO or IEC (International Organization for Standardization, International Electrotechnical Commission) specification 3166.

Country or region

Country or region string

Australia

"aus" or "australia"

Austria

"austria" or "aut"

Belgium

"bel" or "belgium"

Brazil

"bra" or "brazil"

Canada

"can" or "canada"

Czech Republic

"cze" or "czech"

Denmark

"denmark" or "dnk"

Finland

"fin" or "finland"

France

"fra" or "france"

Germany

"deu" or "germany"

Greece

"grc" or "greece"

Hong Kong SAR

"hkg", "hong kong", or "hong-kong"

Hungary

"hun" or "hungary"

Iceland

"iceland" or "isl"

Ireland

"ireland" or "irl"

Italy

"ita" or "italy"

Japan

"japan" or "jpn"

Korea

"kor", "korea"

Mexico

"mex" or "mexico"

Netherlands

"nld", "holland", or "netherlands"

New Zealand

"new zealand", "new-zealand", "nz", or "nzl"

Norway

"nor" or "norway"

People's Republic of China

"china", "chn", "pr china", or "pr-china"

Poland

"pol" or "poland"

Portugal

"prt" or "portugal"

Russia

"rus" or "russia"

Singapore

"sgp" or "singapore"

Slovak Repubic

"svk" or "slovak"

Spain

"esp" or "spain"

Sweden

"swe" or "sweden"

Switzerland

"che" or "switzerland"

Taiwan

"taiwan" or "twn"

Turkey

"tur" or "turkey"

United Kingdom

"britain", "england", "gbr", "great britain", "uk", "united kingdom", or "united-kingdom"

United States of America

"america", "united states", "unitedstates", "us", or "usa"




uSleep

Description

Suspends the process for a specified number of milliseconds

Syntax

string uSleep(msecs)

Parameters

integer msecs

Number of milliseconds for which to suspend the process

Examples

Example 1

uSleep(1000) // suspends the process for one second



uSystemFolder

Description

Returns predefined application and system paths

Syntax

string uSystemFolder([foldertype])

Examples

Example 1

uSystemFolder("APP_LOG")  // returns the path to the log directory

Usage

Use uSystemFolder to access a special directory on the file system. You can specify the following folders:

Group

Name

Description

Application

APP_MAIN

The base application path. A typical path is C:\Program Files\ETL.

Application

APP_LIB

Shared library directory. A typical path is application_directory\lib.

Application

APP_LOG

Shared library directory. A typical path is application_directory\lib.

Application

APP_CONFIG

Config file directory. A typical path is application_directory\etc.

Application

APP_LICENSE

License directory. A typical path is application_directory\license.

Application

APP_SCRIPT

Script directory. A typical path is application_directory\scripts.

Application

APP_GRAMMAR

Grammar directory. A typical path is application_directory\grammar.

Application

APP_LANGUAGE

Language file directory. A typical path is application_directory\language.

Application

APP_DATABASE

Database directory. A typical path is application_directory\database.

Application

APP_TEMP

Temporary directory. A typical path is application_directory\temp.

Application

APP_DEMODATA

Demodata directory. A typical path is application_directory\demodata.

Application

APP_USERDATA

Directory where user specific files are stored. Typical path is C:\Documents and Settings\username\Application Data\ETL.

Windows

ALTSTARTUP

The file system directory that corresponds to the user’s non-localized Startup program group.

Windows

APPDATA

The file system directory that serves as a common repository for application-specific data. A typical path is C:\Documents and Settings\username\Application Data.

Windows

CDBURN_AREA

The file system directory acting as a staging area for files waiting to be written to CD. A typical path is C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\CD Burning.

Windows

COMMON_ADMINTOOLS

The file system directory containing administrative tools for all users of the computer

Windows

COMMON_APPDATA

The file system directory containing application data for all users. A typical path is C:\Documents and Settings\All Users\Application Data.

Windows

COMMON_DESKTOPDIRECTORY

The file system directory that contains files and folders that appear on the desktop for all users. A typical path is C:\Documents and Settings\All Users\Desktop. Valid only for Windows NT systems.

Windows

COMMON_DOCUMENTS

The file system directory that contains documents that are common to all users. A typical paths is C:\Documents and Settings\All Users\Documents.

Windows

COMMON_FAVORITES

The file system directory that serves as a common repository for favorite items common to all users. Valid only for Windows NT systems.

Windows

COMMON_MUSIC

The file system directory that serves as a repository for music files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Music.

Windows

COMMON_PICTURES

The file system directory that serves as a repository for image files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Pictures.

Windows

COMMON_PROGRAMS

The file system directory that contains the directories for the common program groups that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs. Valid only for Windows NT systems.

Windows

COMMON_STARTMENU

The file system directory that contains the programs and folders that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu. Valid only for Windows NT systems.

Windows

COMMON_STARTUP

The file system directory that contains the programs that appear in the Startup folder for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs\Startup. Valid only for Windows NT systems.

Windows

COMMON_TEMPLATES

The file system directory that contains the templates that are available to all users. A typical path is C:\Documents and Settings\All Users\Templates. Valid only for Windows NT systems.

Windows

COMMON_VIDEO

The file system directory that serves as a repository for video files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Videos.

Windows

COOKIES

The file system directory that serves as a common repository for Internet cookies. A typical path is C:\Documents and Settings\username\Cookies.

Windows

DESKTOP

The virtual folder representing the Windows desktop, the root of the namespace.

Windows

DESKTOPDIRECTORY

The file system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself). A typical path is C:\Documents and Settings\username\Desktop.

Windows

FAVORITES

The file system directory that serves as a common repository for the user's favorite items. A typical path is C:\Documents and Settings\username\Favorites.

Windows

FONTS

A virtual folder containing fonts. A typical path is C:\Windows\Fonts.

Windows

HISTORY

The file system directory that serves as a common repository for Internet history items.

Windows

INTERNET_CACHE

The file system directory that serves as a common repository for temporary Internet files. A typical path is C:\Documents and Settings\username\Local Settings\Temporary Internet Files.

Windows

MYDOCUMENTS

Virtual folder representing the My Documents desktop item.

Windows

MYMUSIC

The file system directory that serves as a common repository for music files. A typical path is C:\Documents and Settings\User\My Documents\My Music.

Windows

MYPICTURES

The file system directory that serves as a common repository for image files. A typical path is C:\Documents and Settings\username\My Documents\My Pictures.

Windows

MYVIDEO

The file system directory that serves as a common repository for video files. A typical path is C:\Documents and Settings\username\My Documents\My Videos.

Windows

NETHOOD

A file system directory containing the link objects that may exist in the My Network Places virtual folder. It is not the same as CSIDL_NETWORK, which represents the network namespace root. A typical path is C:\Documents and Settings\username\NetHood.

Windows

PERSONAL

The virtual folder representing the My Documents desktop item. This is equivalent to MYDOCUMENTS.

Windows

PRINTHOOD

The file system directory that contains the link objects that can exist in the Printers virtual folder. A typical path is C:\Documents and Settings\username\PrintHood.

Windows

PROFILE

The user's profile folder. A typical path is C:\Documents and Settings\username. Applications should not create files or folders at this level; they should instead place data under the locations referred to by APPDATA or LOCAL_APPDATA.

Windows

PROGRAM_FILES

The Program Files folder. A typical path is C:\Program Files.

Windows

PROGRAM_FILES_COMMON

A folder for components that are shared across applications. A typical path is C:\Program Files\Common. Valid only for Windows NT, Windows 2000, and Windows XP systems.

Windows

PROGRAMS

The file system directory that contains the user's program groups (which are themselves file system directories). A typical path is C:\Documents and Settings\username\Start Menu\Programs.

Windows

RECENT

The file system directory that contains shortcuts to the user's most recently used documents. A typical path is C:\Documents and Settings\username\My Recent Documents. To create a shortcut in this folder, use SHAddToRecentDocs. In addition to creating the shortcut, this function updates the shell's list of recent documents and adds the shortcut to the My Recent Documents submenu of the Start menu.

Windows

SENDTO

The file system directory that contains Send To menu items. A typical path is C:\Documents and Settings\username\SendTo.

Windows

STARTMENU

The file system directory containing Start menu items. A typical path is C:\Documents and Settings\username\Start Menu.

Windows

STARTUP

The file system directory that corresponds to the user's Startup program group. The system starts these programs whenever any user logs in to Windows NT or starts Windows 95. A typical path is C:\Documents and Settings\username\Start Menu\Programs\Startup.

Windows

SYSTEM

The Windows System folder. A typical path is C:\Windows\System32.

Windows

TEMPLATES

The file system directory that serves as a common repository for document templates. A typical path is C:\Documents and Settings\username\Templates.

Windows

WINDOWS

The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. A typical path is C:\Windows.