Built-in functions

Top  Previous  Next

The following functions can be used with Variables and IF-statements.

 

GetSelectedFolder

Returns the name of the selected folder.

 

Example:

$selected = GetSelectedFolder
MessageBox "The selected folder {$selected} will now be checked..."
CheckFolder "{$selected}"

 

GetUpdatedBookmarkCount

Returns the number of updated bookmarks.

 

GetLastCheckUpdatedBookmarkCount

Returns the number of updated bookmarks from the last check run.

 

GetFolderBookmarkCount(...)

Returns the number of bookmarks in the specified folder. Folder and sub folders must be separated with a backslash, eg. GetFolderBookmarkCount("Software\WSW")

 

GetFolderUpdatedBookmarkCount(...)

Returns the number of updated bookmarks in the specified folder. Folder and sub folders must be separated with a backslash, eg. GetFolderUpdatedBookmarkCount("Software\WSW")

 

GetUniqueID

Returns a unique string ID, for example 20041212120023123. This value can be used, if unique filenames are required. For example to generate a report into a new, unique file.

 

GetDateTime(...)

Returns the current date/time. As parameter you can define the format of the date.

 

Format:

yy - current year with 2 digits

yyyy - current year with 4 digits

m - current month with 1 or 2 digits, no leading zero (1-12)

mm - current month with 2 digits, leading zero (01-12)

mmm - name of current month, 3 characters (jan, feb...)

mmmm - full name of current month

d - current day with 1 or 2 digits, no leading zero (1-31)

dd - current day with 2 digits, leading zero (01-31)

ddd - name of current day with 2 characters

dddd - name of current day

hh - hours

nn - minutes

ss - seconds

 

Example:

$date1 = GetDateTime("yyyy-mm-dd")
$format = "dd-mm-yyyy"
$date2 = GetDateTime($format)

 

GetDayOfTheWeek

Returns the number of the week day. 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc.

 

GetQuestionBoxResult

Returns the clicked button of the QuestionBox command. The result is "yes" or "no".

 

Uppercase

Converts a string into upper case.

 

Lowercase

Converts a string into lower case.

 

FileExists("...")

Checks if the specified file exists. The result is "1" or "0".

 

Example:

if FileExists("c:\test\export.htm") = "1" then MessageBox "File export.htm exists"

 

GetBookmarkFileName

Returns the name of the currently opened bookmark file (full path + filename), eg. "c:\wsw\bm.wsw".

 

Example:

// Store absolute path + filename of the currently opened bookmark file in variable $s
$s = "{bookmarkdir}" + GetBookmarkFilename
 
// Open the bookmark file "c:\wsw\bm.wsw" if it is not the opened bookmark file
$s1 = "{bookmarkdir}" + GetBookmarkFilename
$s1 = Lowercase($s1)
if $s1 <> "c:\wsw\bm.wsw" then OpenBookmarkFile "c:\wsw\bm.wsw"

 

RasIsConnected

Returns 1 if a dialup connections exists and 0 otherwise. You must have "dialup" configured in the program configuration, otherwise this function always returns 0.

See also RasDial and RasHangup.

 

TestConnection(...)

Tests with the specified URL if an internet connection exists. If the specified URL can be accessed, this function returns 1. If the specified URL reports an error, this function returns 0.

 

Example:

if TestConnection("http://www.domain.com") = 0 then AbortScript




Translate document: