Miscellaneous functions




uCommandLine

Description

Returns the command line string of the current process.

Syntax

string uCommandLine()

Parameters

None

The name of the environment variable to read.

Examples

Example 1

uGetEnv(“LOAD_MAX_VALUE”)



uGetEnv

Description

Returns the value of an environment variable.

Syntax

string uGetEnv(variable)

Parameters

string variable

The name of the string variable.

Examples

Example 1

uCommandLine() // returns something like "D:\Sybase\IQETL\win32\Engine.exe engineman.lbr"



uGuid

Description

Returns a Global Unique Identifier (GUI) in one of the following specified formats:

Syntax

string uGuid(format)

Parameters

string format

The format for the GUID value to be returned.

Examples

Example 1

To create a unique identifier:

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



uMD5

Description

Allows you to generate a checksum with a fixed length of 32 characters from a given string.

Syntax

string uMD5(text)

Parameters

string text

The 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

To load an external JavaScript file:

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



uSetEnv

Description

Writes a value to an environment variable

Syntax

string uSetEnv(variable, value)

Parameters

string variable

Name of the environment variable to set

string value

The value to set

Examples

Example 1

uSetEnv(“LOAD_MAX_VALUE”, IN.Date) 



uSet Locale

Description

Changes the current date and time settings to a different language.

Syntax

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

Parameters

string language

The name of the language.

string country

The string for the country.

string codepage

The codepage string.

Examples

Example 1

To retrieve month names in a different locale:

uSetLocale("English")     // switch to english
uMonthName("2005-03-22")  // returns "March"
uSetLocale("German")      // switch to german
uMonthName("2005-03-22")  // returns "März"
uSetLocale("C")           // switch back to default 

Usage


Language Strings

The following language strings are recognized. uSetLocale does not accept any language that is not supported by the operating system.

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

Primary Language 

Sub-language

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

Engish (UK)

“eng”, “english-uk”, or “uk”

English

English (USA)

“english”, “american-english”, “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 “french-canadian”

French

French (default)

“fra” or “french”

French

French (Swiss)

“french-swiss” or “frs”

German

German (Austrian)

“dea” or “german-austrian”

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 “norwegian-bokmal”

Norwegian

Norwegian (default)

“norwegian”

Norwegian

Norwegian (Nynorsk)

“non” or “norwegian-nynorsk”

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/Region Strings

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

Country/Region

Country/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

“lor”, “korea”

Mexico

“mex” or “mexico”

Netherlands

“nld”, “holland” or “netherlands”

New Zealand

“newzealand”, “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 Republic

“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”, “united-states”, “us”, or “usa”




uSleep

Description

Suspends the process for a specified amount of milliseconds.

Syntax

string uSleep(msecs)

Parameters

integer msecs

The number of milliseconds to suspend.

Examples

Example 1

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



uSystemFolder

Description

Returns predefined application and system paths.

Syntax

string uSystemFolder([foldertype])

Parameters

string foldertype (optional)

Specifies the folder to return. The default is “System”.

Examples

Example 1

uSystemFolder(“APP LOG”) // returns the path to the log directory 

Usage

You can specify the folders listed in the following table.

Group

Name

Description

Application

APP_MAIN

The base application path. A typical path is “c:\Program Files\Sybase\IQETL41”.

Application

APP_LIB

Shared library directory, typically in the “lib” folder of the application’s directory.

Application

APP_LOG

Shared library directory, typically in the “lib” folder of the application’s directory.

Application

APP_CONFIG

Config file directory, typically in the “etc” folder of the application’s directory.

Application

APP_LICENSE

License directory, typically in the “license” folder of the application’s directory.

Application

APP_SCRIPT

Script directory, typically in the “scripts” folder of the application’s directory.

Application

APP_GRAMMAR

Grammar directory, typically in the “grammar” folder of the application’s directory.

Application

APP_LANGUAGE

Language file directory, typically in the “language” folder of the application’s directory.

Application

APP_DATABASE

Database directory, typically in the “database” folder of the application’s directory.

Application

APP_TEMP

Temporary directory, typically in the “temp” folder of the application’s directory.

Application

APP_DEMODATA

Demodata directory, typically in the “demodata” folder of the application’s directory.

Application

APP_USERDATA

Directory where user-spcecific files arestored. The typical path is “C:\Documents and Settings\username\Application Data\Sybase\IQETL\41”.

Windows

ALTSTARTUP

The file system directory that corresponds to the user’s nonlocalized 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

BITBUCKET

The virtual folder containing the objects in the user’s Recycle Bin.

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_ALTSTARTUP

The file system directory that corresponds to the nonlocalized Startup program group for all users.Valid only for Microsoft Windows NT systems.

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 path 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

DRIVES

The virtual folder representing My Computer, containing everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives.

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

A virtual folder for Internet Explorer (icon on desktop).

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

LOCAL_APPDATA

The file system directory that serves as a data repository for local (nonroaming) applications. A typical path is “C:\Documents and Settings\username\Local Settings\Application Data”.

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

NETWORK

A virtual folder representing Network Neighborhood, the root of the network namespace hierarchy.

Windows

PERSONAL

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

Windows

PRINTERS

The virtual folder containing installed printers.

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 put their 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 onto 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”.