<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Tech Note XX: Using the NSBSystemLib Shared Library</TITLE>
</HEAD>
<BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff">

<TABLE CELLSPACING=0 BORDER=0 WIDTH=478>
<TR><TD WIDTH="22%" VALIGN="TOP">
<P><IMG SRC="images/BigIcon.GIF" WIDTH=86 HEIGHT=103></TD>
<TD WIDTH="78%" VALIGN="TOP">
<B><FONT FACE="Helvetica" SIZE=5>
      <P>Tech Note XX: Using the NSBSystemLib Shared Library</P>
      <P>Mon dd, yyyy</P>
</FONT><FONT FACE="Helvetica" SIZE=4><P>&nbsp;</P>
</FONT><FONT FACE="Helvetica" SIZE=2><P>Copyright 2001 NS BASIC Corporation</font></B></TD>
</TR>
</TABLE>
<HR>

<P>(Special thanks to Ron Glowka)

<pre>
       toc here
</pre>

<H2>NSBSystemLib Shared Library Function Reference</H2>:

<pre>


********************************
NSBSystemLib Function Reference:
********************************

<h3>Version Information:</h3>

<a name="Version"><h4>Version</h4>

	version = NSBSystemLib.Version()

    Description:

	Returns the version number of the NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	version as Double

    Example:

	Dim version as Double

	version = NSL.Version()

<a name="CompileInfo"><h4>CompileInfo</h4>

	compileDateTime = NSBSystemLib.CompileInfo()

    Description:

	Returns the date and time that the NSBSystemLib was compiled.

    Parameters:	None

    Returns:	compileDateTime as String

    Example:

	Dim compileDateTime as String

	compileDateTime = NSL.CompileInfo()

<a name="SystemVersion"><h4>SystemVersion</h4>

	version = NSBSystemLib.SystemVersion()

    Description:

	Returns the version number of the PalmOS system.

    Parameters:	None

    Returns:	version as Double

    Example:

	Dim version as Double

	version = NSL.SystemVersion()

    Notes:

	See also:  GlobalVersionMajor(), GlobalVersionMinor()

<h3>Access To Shared Library Global Variables:</h3>

Currently, shared libraries may return only one numeric
value from a function call.  A number of functions in
this library, however, have multiple numeric values that
they retrieve.  In order to make these values available,
they are stored as a library global variable.  The
following functions return the values of these global
variables.

In general, the global access functions are used after
making a specific function call.  Example:

   changed = NSL.SelectOneTime(selHour, selMinute, title)
   If Changed = 1 Then
       selHour = NSL.GlobalHour()
       selMinute = NSL.GlobalMinute()
   End If

<a name="GlobalVersionMajor"><h4>GlobalVersionMajor</h4>

	gblMajor = NSBSystemLib.GlobalVersionMajor()

    Description:

	Returns the major version number portion of the PalmOS version.
	This value is stored as a library global variable at library
	load time.

    Parameters:	None

    Returns:	gblMajor as Integer

    Example:

	Dim gblMajor as Integer

	gblMajor = NSL.GlobalVersionMajor()

    Notes:

	See also:  SystemVersion()

<a name="GlobalVersionMinor"><h4>GlobalVersionMinor</h4>

	gblMinor = NSBSystemLib.GlobalVersionMinor()

    Description:

	Returns the minor version number portion of the PalmOS version.
	This value is stored as a library global variable at library
	load time.

    Parameters:	None

    Returns:	gblMinor as Integer

    Example:

	Dim gblMinor as Integer

	gblMinor = NSL.GlobalVersionMinor()

    Notes:

	See also:  SystemVersion()

<a name="GlobalX"><h4>GlobalX</h4>

	x = NSBSystemLib.GlobalX()

    Description:

	Returns the value of the global variable "x" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	x as Integer

    Example:

	Dim x as Integer

	x = NSL.GlobalX()

<a name="GlobalY"><h4>GlobalY</h4>

	y = NSBSystemLib.GlobalY()

    Description:

	Returns the value of the global variable "y" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	y as Integer

    Example:

	Dim y as Integer

	y = NSL.GlobalY()

<a name="GlobalStartX"><h4>GlobalStartX</h4>

	startX = NSBSystemLib.GlobalStartX()

    Description:

	Returns the value of the global variable "startX" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	startX as Integer

    Example:

	Dim startX as Integer

	startX = NSL.GlobalStartX()

<a name="GlobalStartY"><h4>GlobalStartY</h4>

	startY = NSBSystemLib.GlobalStartY()

    Description:

	Returns the value of the global variable "startY" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	startY as Integer

    Example:

	Dim startY as Integer

	startY = NSL.GlobalStartY()

<a name="GlobalEndX"><h4>GlobalEndX</h4>

	endX = NSBSystemLib.GlobalEndX()

    Description:

	Returns the value of the global variable "endX" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	endX as Integer

    Example:

	Dim endX as Integer

	endX = NSL.GlobalEndX()

<a name="GlobalEndY"><h4>GlobalEndY</h4>

	endY = NSBSystemLib.GlobalEndY()

    Description:

	Returns the value of the global variable "endY" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	endY as Integer

    Example:

	Dim endY as Integer

	endY = NSL.GlobalEndY()

<a name="GlobalStartPos"><h4>GlobalStartPos</h4>

	startPos = NSBSystemLib.GlobalStartPos()

    Description:

	Returns the value of the global variable "startPos" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	startPos as Integer

    Example:

	Dim startPos as Integer

	startPos = NSL.GlobalStartPos()

<a name="GlobalEndPos"><h4>GlobalEndPos</h4>

	endPos = NSBSystemLib.GlobalEndPos()

    Description:

	Returns the value of the global variable "endPos" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	endPos as Integer

    Example:

	Dim endPos as Integer

	endPos = NSL.GlobalEndPos()

<a name="GlobalWidth"><h4>GlobalWidth</h4>

	width = NSBSystemLib.GlobalWidth()

    Description:

	Returns the value of the global variable "width" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	width as Integer

    Example:

	Dim width as Integer

	width = NSL.GlobalWidth()

<a name="GlobalHeight"><h4>GlobalHeight</h4>

	height = NSBSystemLib.GlobalHeight()

    Description:

	Returns the value of the global variable "height" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	height as Integer

    Example:

	Dim height as Integer

	height = NSL.GlobalHeight()

<a name="GlobalHour"><h4>GlobalHour</h4>

	gblHour = NSBSystemLib.GlobalHour()

    Description:

	Returns the value of the global variable "hour" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	gblHour as Integer

    Example:

	Dim gblHour as Integer

	gblHour = NSL.GlobalHour()

    Notes:

	See also:  SelectOneTime()

<a name="GlobalMinute"><h4>GlobalMinute</h4>

	gblMinute = NSBSystemLib.GlobalMinute()

    Description:

	Returns the value of the global variable "minute" in the
	NSBSystemLib Shared Library.

    Parameters:	None

    Returns:	gblMinute as Integer

    Example:

	Dim gblMinute as Integer

	gblMinute = NSL.GlobalMinute()

    Notes:

	See also:  SelectOneTime()

<h3>Bit and String Manipulations:</h3>

<a name="String4ToInt"><h4>String4ToInt</h4>

	intValue = NSBSystemLib.String4ToInt(fourByteString)

    Description:

	Returns the integer value of a 4 byte string.  This function
	is useful for calculating the integer value of Creator IDs,
	Application Types, Resource Types, etc.

    Parameter:	fourByteString as String

    Returns:	intValue as Integer

    Example:

	Dim intValue as Integer
	Dim fourByteString as String
	
	fourByteString = "libr"
	intValue = NSL.String4ToInt(fourByteString)

    Notes:

	See also:  IntToString4()

<a name="IntToString4"><h4>IntToString4</h4>

	fourByteString = NSBSystemLib.IntToString4(intValue)

    Description:

	Returns a 4 byte string from an integer value.  This function
	is useful for retrieving the string value of integer
	Creator IDs, Application Types, Resource Types, etc.

    Parameter:	intValue as Integer

    Returns:	fourByteString as String

    Example:

	Dim fourByteString as String
	Dim intValue as Integer
	
	intValue = 1818845810  '"libr"
	fourByteString = NSL.IntToString4(intValue)

    Notes:

	See also:  String4ToInt()

<a name="ANDInt"><h4>ANDInt</h4>

	result = NSBSystemLib.ANDInt(int1, int2)

    Description:

	Returns a bitwise AND on the int1 and int2 parameters.

    Parameters:	int1 as Integer
		int2 as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim int1 as Integer
	Dim int2 as Integer

	result = NSL.ANDInt(int1, int2)

<a name="ORInt"><h4>ORInt</h4>

	result = NSBSystemLib.ORInt(int1, int2)

    Description:

	Returns a bitwise OR on the int1 and int2 parameters.

    Parameters:	int1 as Integer
		int2 as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim int1 as Integer
	Dim int2 as Integer

	result = NSL.ORInt(int1, int2)

<a name="XORInt"><h4>XORInt</h4>

	result = NSBSystemLib.XORInt(int1, int2)

    Description:

	Returns a bitwise XOR on the int1 and int2 parameters.

    Parameters:	int1 as Integer
		int2 as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim int1 as Integer
	Dim int2 as Integer

	result = NSL.XORInt(int1, int2)

<a name="OnesComplement"><h4>OnesComplement</h4>

	result = NSBSystemLib.OnesComplement(intValue)

    Description:

	Returns the "one's complement" of the intValue parameter.
	This essentially turns all 1 bits to 0 and all 0 bits to 1.

    Parameter:	intValue as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim intValue as Integer

	result = NSL.OnesComplement(intValue)

<a name="BitValue"><h4>BitValue</h4>

	result = NSBSystemLib.BitValue(intValue, bitNumber)

    Description:

	Returns 1 if the specified bit number is 1, otherwise it
	returns 0.

    Parameters:	intValue as Integer
		bitNumber as Integer
		       Bits are numbered from right to left from 0 to 31.

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim intValue as Integer
	Dim bitNumber as Integer

	result = NSL.BitValue(intValue, bitNumber)

<a name="BitsValue"><h4>BitsValue</h4>

	result = NSBSystemLib.BitsValue(intValue, bitNumber, numberOfBits)

    Description:

	Returns the integer value of the specified bits.  The bits
	retrieved are the bits to the right of the specified bit
	number.  Therefore, BitsValue(intValue, 7, 3) returns the
	value of bits 7, 6, and 5.

    Parameters:	intValue as Integer
		bitNumber as Integer
		       Bits are numbered from right to left from 0 to 31.
		numberOfBits as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim intValue as Integer
	Dim bitNumber as Integer
	Dim numberOfBits as Integer

	result = NSL.BitsValue(intValue, bitNumber, numberOfBits)

<a name="SetBitValue"><h4>SetBitValue</h4>

	result = NSBSystemLib.SetBitValue(intValue, bitNumber, bitValue)

    Description:

	Sets the bit specified by bitNumber to the specified
	bit value.

    Parameters:	intValue as Integer
		bitNumber as Integer
		       Bits are numbered from right to left from 0 to 31.
		bitValue as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim intValue as Integer
	Dim bitNumber as Integer
	Dim bitValue as Integer

	result = NSL.SetBitValue(intValue, bitNumber, bitValue)

<a name="SetBitsValue"><h4>SetBitsValue</h4>

	result = NSBSystemLib.SetBitsValue(intValue, bitsValue, bitNumber, numberOfBits)

    Description:

	Sets the specified bits to the integer value of the
	specified bits.  The bits set are the bits to the right of the
	specified bit number.  Therefore,
	SetBitsValue(intValue, 7, 3) sets the value of bits 7, 6,
	and 5.

    Parameters:	intValue as Integer
		bitsValue as Integer
		       Bits are numbered from right to left from 0 to 31.
		bitNumber as Integer
		numberOfBits as Integer

    Returns:	result as Integer

    Example:

	Dim result as Integer
	Dim intValue as Integer
	Dim bitsValue as Integer
	Dim bitNumber as Integer
	Dim numberOfBits as Integer

	result = NSL.SetBitsValue(intValue, bitsValue, bitNumber, numberOfBits)

<a name="IntToHex"><h4>IntToHex</h4>

	hexValue = NSBSystemLib.IntToHex(intValue, trimLeading)

    Description:

	Convert the specified integer value to a hexadecimal string.

    Parameters:	intValue as Integer
		trimLeading as Integer
		       0 = do not trim leading zeros from result string
		       1 = trim leading zeros from result string.

    Returns:	hexValue as String

    Example:

	Dim hexValue as String
	Dim intValue as Integer
	Dim trimLeading as Integer

	hexValue = NSL.IntToHex(intValue, trimLeading)

<a name="HexToInt"><h4>HexToInt</h4>

	intValue = NSBSystemLib.HexToInt(hexValue)

    Description:

	Convert the specified hexadecimal string to an integer value.

    Parameter:	hexValue as String

    Returns:	intValue as Integer

    Example:

	Dim intValue as Integer
	Dim hexValue as String

	intValue = NSL.HexToInt(hexValue)

<a name="IntToBin"><h4>IntToBin</h4>

	binValue = NSBSystemLib.IntToBin(intValue, trimLeading)

    Description:

	Convert the specified integer value to a binary string.

    Parameters:	intValue as Integer
		trimLeading as Integer
		       0 = do not trim leading zeros from result string
		       1 = trim leading zeros from result string.

    Returns:	binValue as String

    Example:

	Dim binValue as String
	Dim intValue as Integer
	Dim trimLeading as Integer

	binValue = NSL.IntToBin(intValue, trimLeading)

<a name="BinToInt"><h4>BinToInt</h4>

	intValue = NSBSystemLib.BinToInt(binValue)

    Description:

	Convert the specified binary string to an integer value.

    Parameter:	binValue as String

    Returns:	intValue as Integer

    Example:

	Dim intValue as Integer
	Dim binValue as String

	intValue = NSL.BinToInt(binValue)

<a name="DelimitedItem"><h4>DelimitedItem</h4>

	item = NSBSystemLib.DelimitedItem(str, delimiter, nbr)

    Description:

	Returns a particular substring item from a string that
	contains multiple items separated by a particular delimiter.

    Parameters:	str as String
		       A string containing delimited items.
		delimiter as String
		       A string containing the delimiter character or characters.
		nbr as Integer
		       The item number to return.  Item numbers begin with 1.

    Returns:	item as String
		       The delimiter string will be returned if the requested
		       item is not present.

    Example:

	Dim item as String
	Dim str as String
	Dim delimiter as String
	Dim nbr as Integer
	
	str = "Joe;Mary;Jane"
	delimiter = ";"
	nbr = 2
	'Returns the string "Mary"
	item = NSL.DelimitedItem(str, delimiter, nbr)

    Notes:

	The input string can not be longer than 250 characters.

<h3>Localization Functions:</h3>

<a name="LocalizeNumber"><h4>LocalizeNumber</h4>

	localNbrStr = NSBSystemLib.LocalizeNumber(stdNbrStr)

    Description:

	Convert a number string in standard/US format to a
	localized format as determined by system preferences.

    Parameter:	stdNbrStr as String

    Returns:	localNbrStr as String

    Example:

	Dim localNbrStr as String
	Dim stdNbrStr as String
	
	stdNbrStr = "4,123.56"
	localNbrStr = NSL.LocalizeNumber(stdNbrStr)

<a name="DelocalizeNumber"><h4>DelocalizeNumber</h4>

	stdNbrStr = NSBSystemLib.DelocalizeNumber(localNbrStr)

    Description:

	Convert a number string to in localized format to a
	standard/US format as determined by system preferences.

    Parameter:	localNbrStr as String

    Returns:	stdNbrStr as String

    Example:

	Dim stdNbrStr as String
	Dim localNbrStr as String
	
	locNbrStr = "4.123,56"
	stdNbrStr = NSL.DelocalizeNumber(localNbrStr)

<a name="LocalizeDate"><h4>LocalizeDate</h4>

	localDateStr = NSBSystemLib.LocalizeDate(stdDateStr, ToDateFormat, longDateFormat)

    Description:

	Convert a date string in standard/US format to a localized
	date format as determined by system preferences.

    Parameters:	stdDateStr as String
		       The date string may also contain the time.  Time values
		       will be ignored.
		ToDateFormat as Integer
		       0 = stdDateStr format is "MM/DD/YY[YY]"
		       1 = stdDateStr format is "[YY]YY/MM/DD"
		longDateFormat as Integer
		       0 = use short date format preference
		       1 = user long date format preference

    Returns:	localDateStr as String

    Example:

	Dim localDateStr as String
	Dim stdDateStr as String
	Dim ToDateFormat as Integer
	Dim longDateFormat as Integer
	
	stdDateStr = DateMMDDYY(Today())
	ToDateFormat = 0
	longDateFormat = 0
	localDateStr = NSL.LocalizeDate(stdDateStr, ToDateFormat, longDateFormat)

<h3>HotSync Data:</h3>

<a name="SyncUserName"><h4>SyncUserName</h4>

	userName = NSBSystemLib.SyncUserName()

    Description:

	Returns the HotSync user name.

    Parameters:	None

    Returns:	userName as String

    Example:

	Dim userName as String

	userName = NSL.SyncUserName()

<a name="SuccessfulSync"><h4>SuccessfulSync</h4>

	syncDate = NSBSystemLib.SuccessfulSync()

    Description:

	Returns the date, in system format, of the last successful
	HotSync operation.  System format dates are expressed as
	the number of seconds since January 1st, 1904.  Use the
	StringDateTime(), StringDate(), or StringTime() functions
	to retrieve a string representation of a system format date.

    Parameters:	None

    Returns:	syncDate as Integer

    Example:

	Dim syncDate as Integer

	syncDate = NSL.SuccessfulSync()

<a name="LastSync"><h4>LastSync</h4>

	syncDate = NSBSystemLib.LastSync()

    Description:

	Returns the date, in system format, of the last successful
	or unsuccessful HotSync operation.  System format dates are
	expressed as the number of seconds since January 1st, 1904.
	Use the StringDateTime(), StringDate(), or StringTime()
	functions to retrieve a string representation of a system
	format date.

    Parameters:	None

    Returns:	syncDate as Integer

    Example:

	Dim syncDate as Integer

	syncDate = NSL.LastSync()

<h3>Alarm Functions:</h3>

<a name="SetAlarmReset"><h4>SetAlarmReset</h4>

	NSBSystemLib.SetAlarmReset resetTime, resetLimit

    Description:

	Establishes an automatic alarm reset interval for the next
	alarm that is set.

    Parameters:	resetTime as Integer
		       Reset interval in seconds
		         0 = do not automatically reset alarm
		resetLimit as Integer
		       Limit to the number of automatic resets that can occur.
		        -1 = resets are not limited - CancelAlarm() must be
		             used to stop automatic resets.
		         0 = do not automatically reset alarm

    Returns:	None

    Example:

	Dim resetTime as Integer
	Dim resetLimit as Integer
	
	resetTime = 10
	resetLimit = -1
	NSL.SetAlarmReset resetTime, resetLimit

    Notes:

	 If this feature is to be used, it must be called before
	 each SetAlarm() function.

<a name="SetAlarm"><h4>SetAlarm</h4>

	status = NSBSystemLib.SetAlarm(alarmPgm, alarmTime, alarmCmd, alarmMsg)

    Description:

	Sets an alarm for the specified program.  The alarm features
	in this library are mostly intended to be used with only the
	NSBAlarmProxy programs.

    Parameters:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"
		alarmTime as Integer
		       Absolute alarm time in system time format or a time
		       increment in seconds from the current time.  This time
		       is considered as an absolute time if its value is greater
		       or equal to the value of the current system time minus 5
		       minutes.
		alarmCmd as Integer
		       Alarm Command explanations:
		         -32767 to -30001 = "Timer" commands
		            These commands have the least amount of overhead
		            associated with them.  They do not write to the
		            alarm log information.  In addition, they automat-
		            ically reset the alarm.  As such, they must be
		            specifically cancelled using the CancelAlarm()
		            function.
		       
		            These commands queue an event which is the
		            absolute (positive) value of the command.
		       
		            The reset interval (seconds) used is calculated as:
		                 abs(cmd) - 30000
		                 example:  -30005 has a reset interval of 5
		                                  seconds and queues an event
		                                  with an event type of 30005.
		         0 = enqueue a "nilEvent" - can be used to just simply
		             wake up or turn on a PalmOS device
		         1 = sound a system alarm sound only
		         2 = sound a system alarm sound and produce an Alert
		             with the message specified in the alarmMsg parameter.
		         3 = start the program with the name specified in the
		             alarmMsg parameter.  The alarmMsg parameter, in this
		             case, is a coded string with the following format:
		                 <programName>[,<launcherWaitTime>][;<userInfo>]
		                 examples:  "Address"
		                            "Address;started by MyProg"
		                            "Address,6;started by MyProg"
		                 notes:  The launcherWaitTime is the time, in
		                         in seconds to wait for the current program
		                         to terminate - the default is 2 seconds.
		                         The userInfo, as well as the entire string,
		                         is written to the alarmLog.  It can be used
		                         for any purpose you like.
		          4 to 255 = enqueue a Key Event with a value equal to
		                     the specified alarmCmd
		          24832 to 30000 = enqueue a generic event with an event
		                           type equal to the specified alarmCmd.
		alarmMsg as String
		        A string of 80 characters or less that is used as the
		        message for alarmCmd 2 or the program code for alarmCmd 3.
		        It is also written to the alarm log to provide any info.
		        that may be useful.

    Returns:	status as Integer
		        0 = no error
		       -1 = specified alarm program is not installed
		       -2 = almErrorMemory - insufficient memory
		       -3 = almErrorFull - alarm queue is full
		       -4 = unexpected/unrecognized error

    Example:

	Dim status as Integer
	Dim alarmPgm as String
	Dim alarmTime as Integer
	Dim alarmCmd as Integer
	Dim alarmMsg as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmTime = 3600    ' 1 hour from now
	alarmCmd = 3
	alarmMsg = "Hey Wake UP!"
	status = NSL.SetAlarm(alarmPgm, alarmTime, alarmCmd, alarmMsg)

    Notes:

	See also:  SystemTime()

<a name="CancelAlarm"><h4>CancelAlarm</h4>

	status = NSBSystemLib.CancelAlarm(alarmPgm)

    Description:

	Cancel an alarm set, if any, for the specified program.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	status as Integer
		        0 = no error
		       -1 = specified alarm program is not installed
		       -2 = almErrorMemory - insufficient memory
		       -3 = almErrorFull - alarm queue is full
		       -4 = unexpected/unrecognized error

    Example:

	Dim status as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	status = NSL.CancelAlarm(alarmPgm)

<a name="GetAlarm"><h4>GetAlarm</h4>

	alarmTime = NSBSystemLib.GetAlarm(alarmPgm, alarmCmd, alarmMsg)

    Description:

	Retrieves information about a currently set alarm.

    Parameters:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"
		alarmCmd as String
		       AlarmCmd as a string.  This value is returned and
		       must be initialized to a maximum length before calling
		       the function.  This value should never be more than
		       6 characters in length.
		alarmMsg as String
		       Alarm message as a string.  This value is returned and
		       must be initialized to a maximum length before calling
		       the function.  This value should never be more than
		       80 characters in length.

    Returns:	alarmTime as Integer
		       Alarm time in system time format.  This value is expressed
		       as the number of seconds since January 1st, 1904.

    Example:

	Dim alarmTime as Integer
	Dim alarmPgm as String
	Dim alarmCmd as String
	Dim alarmMsg as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmCmd = "123456"
	alarmMsg = "1234567890123456789012345678901234567890" _
	         + "1234567890123456789012345678901234567890"
	alarmTime = NSL.GetAlarm(alarmPgm, alarmCmd, alarmMsg)

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="GetAlarmTime"><h4>GetAlarmTime</h4>

	alarmTime = NSBSystemLib.GetAlarmTime(alarmPgm)

    Description:

	Retrieves information about a currently set alarm.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	alarmTime as Integer
		       Alarm time in system time format.  This value is expressed
		       as the number of seconds since January 1st, 1904.

    Example:

	Dim alarmTime as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmTime = NSL.GetAlarmTime(alarmPgm)

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="GetAlarmResetTime"><h4>GetAlarmResetTime</h4>

	resetTime = NSBSystemLib.GetAlarmResetTime(alarmPgm)

    Description:

	Retrieves information about a currently set alarm.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	resetTime as Integer
		       Alarm reset time in seconds.

    Example:

	Dim resetTime as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	resetTime = NSL.GetAlarmResetTime(alarmPgm)

<a name="GetAlarmResetLimit"><h4>GetAlarmResetLimit</h4>

	resetLimit = NSBSystemLib.GetAlarmResetLimit(alarmPgm)

    Description:

	Retrieves information about a currently set alarm.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	resetLimit as Integer
		       Alarm reset limit.

    Example:

	Dim resetLimit as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	resetLimit = NSL.GetAlarmResetLimit(alarmPgm)

<a name="GetAlarmCommand"><h4>GetAlarmCommand</h4>

	alarmCmd = NSBSystemLib.GetAlarmCommand(alarmPgm)

    Description:

	Retrieves information about a currently set alarm.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	alarmCmd as Integer
		       Alarm command.

    Example:

	Dim alarmCmd as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmCmd = NSL.GetAlarmCommand(alarmPgm)

<a name="GetAlarmMessage"><h4>GetAlarmMessage</h4>

	alarmMsg = NSBSystemLib.GetAlarmMessage(alarmPgm)

    Description:

	Retrieves information about a currently set alarm.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	alarmMsg as String
		       Alarm message.

    Example:

	Dim alarmMsg as String
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmMsg = NSL.GetAlarmMessage(alarmPgm)

<a name="AlarmLog"><h4>AlarmLog</h4>

	alarmTime = NSBSystemLib.AlarmLog(alarmPgm, alarmCmd, alarmMsg)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameters:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"
		alarmCmd as String
		       AlarmCmd as a string.  This value is returned and
		       must be initialized to a maximum length before calling
		       the function.  This value should never be more than
		       6 characters in length.
		alarmMsg as String
		       Alarm message as a string.  This value is returned and
		       must be initialized to a maximum length before calling
		       the function.  This value should never be more than
		       80 characters in length.

    Returns:	alarmTime as Integer
		       Alarm time in system time format.  This value is expressed
		       as the number of seconds since January 1st, 1904.

    Example:

	Dim alarmTime as Integer
	Dim alarmPgm as String
	Dim alarmCmd as String
	Dim alarmMsg as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmCmd = "123456"
	alarmMsg = "1234567890123456789012345678901234567890" _
	         + "1234567890123456789012345678901234567890"
	alarmTime = NSL.AlarmLog(alarmPgm, alarmCmd, alarmMsg)

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="AlarmLogAlarmTime"><h4>AlarmLogAlarmTime</h4>

	alarmTime = NSBSystemLib.AlarmLogAlarmTime(alarmPgm)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	alarmTime as Integer
		       Alarm time in system time format.  This value is expressed
		       as the number of seconds since January 1st, 1904.

    Example:

	Dim alarmTime as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmTime = NSL.AlarmLogAlarmTime(alarmPgm)

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="AlarmLogResetTime"><h4>AlarmLogResetTime</h4>

	resetTime = NSBSystemLib.AlarmLogResetTime(alarmPgm)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	resetTime as Integer
		       Alarm time reset time in seconds.

    Example:

	Dim resetTime as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	resetTime = NSL.AlarmLogResetTime(alarmPgm)

<a name="AlarmLogResetLimit"><h4>AlarmLogResetLimit</h4>

	resetLimit = NSBSystemLib.AlarmLogResetLimit(alarmPgm)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	resetLimit as Integer
		       Alarm time reset limit.

    Example:

	Dim resetLimit as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	resetLimit = NSL.AlarmLogResetLimit(alarmPgm)

<a name="AlarmLogResetCount"><h4>AlarmLogResetCount</h4>

	resetCount = NSBSystemLib.AlarmLogResetCount(alarmPgm)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	resetCount as Integer
		       The number of times the alarm as been automatically reset.

    Example:

	Dim resetCount as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	resetCount = NSL.AlarmLogResetCount(alarmPgm)

<a name="AlarmLogCommand"><h4>AlarmLogCommand</h4>

	alarmCmd = NSBSystemLib.AlarmLogCommand(alarmPgm)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	alarmCmd as Integer
		       Alarm command.

    Example:

	Dim alarmCmd as Integer
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmCmd = NSL.AlarmLogCommand(alarmPgm)

<a name="AlarmLogMessage"><h4>AlarmLogMessage</h4>

	alarmMsg = NSBSystemLib.AlarmLogMessage(alarmPgm)

    Description:

	Retrieves information about an alarm that has already been
	processed.

    Parameter:	alarmPgm as String
		       Alarm program.  Example:  "NSBAlarmProxy1"

    Returns:	alarmMsg as String
		       Alarm message.

    Example:

	Dim alarmMsg as String
	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmMsg = NSL.AlarmLogMessage(alarmPgm)

<a name="ClearAlarmLog"><h4>ClearAlarmLog</h4>

	alarmPgm = NSBSystemLib.ClearAlarmLog()

    Description:

	Clears the alarm log data for a specified alarm program.

    Parameters:	None

    Returns:	alarmPgm as String

    Example:

	Dim alarmPgm as String
	
	alarmPgm = "NSBAlarmProxy1"
	alarmPgm = NSL.ClearAlarmLog()

<h3>Database Functions:</h3>

<a name="FindDatabase"><h4>FindDatabase</h4>

	dbLocalID = NSBSystemLib.FindDatabase(cardNo, dbName)

    Description:

	Returns the LocalID of the named database.

    Parameters:	cardNo as Integer
		       This value will most likely be 0.
		dbName as String
		       Database name.

    Returns:	dbLocalID as Integer
		       LocalID if the named database is found.
		       0 if the named database is not found.

    Example:

	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbName as String
	
	cardNo = 0
	dbName = "NSBRuntime"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)

<a name="DatabaseInfo"><h4>DatabaseInfo</h4>

	dbName = NSBSystemLib.DatabaseInfo(cardNo, dbLocalID)

    Description:

	Returns the database name for the specified card number and
	database LocalID.  It also retrieves many other fields of
	database information.  See the example and notes for
	for more information on how to access this data.

    Parameters:	cardNo as Integer
		dbLocalID as Integer

    Returns:	dbName as String

    Example:

	Dim cardNo as Integer
	Dim dbLocalID as Integer
	Dim dbName as String
	Dim dbVersion as Integer
	Dim dbCreationDate as Integer
	Dim dbModificationDate as Integer
	Dim dbBackupDate as Integer
	Dim dbModificationNumber as Integer
	Dim dbAppInfoID as Integer
	Dim dbSortInfoID as Integer
	Dim dbType as Integer
	Dim dbCreatorID as Integer
	
	cardNo = 0
	dbName = "NSBRuntime"
	dbLocalID = NSBNSL.FindDatabase(cardNo, dbName)
	If dbLocalID <> 0 Then
	    dbName = NSL.DatabaseInfo(cardNo, dbLocalID)
	    If dbName <> "" Then
	        dbVersion = NSL.DatabaseVersion()
	        dbCreationDate = NSL.DatabaseCreationDate()
	        dbModificationDate = NSL.DatabaseModificationDate()
	        dbBackupDate = NSL.DatabaseBackupDate()
	        dbModificationNumber = NSL.DatabaseModificationNumber()
	        dbAppInfoID = NSL.DatabaseAppInfoID()
	        dbSortInfoID = NSL.DatabaseSortInfoID()
	        dbType = NSL.DatabaseType()
	        dbCreatorID = NSL.DatabaseCreatorID()
	    EndIf
	EndIf

    Notes:

	 See also:  DatabaseName(), DatabaseAttributes(),
	            DatabaseVersion(), DatabaseCreationDate(),
	            DatabaseModificationDate(), DatabaseBackupDate(),
	            DatabaseModificationNumber(), DatabaseType(),
	            DatabaseCreatorID()

<a name="DatabaseName"><h4>DatabaseName</h4>

	dbName = NSBSystemLib.DatabaseName()

    Description:

	Returns a database name that was previously retrieved by
	a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbName as String

    Example:

	See the example provided with the DatabaseInfo() function.

<a name="DatabaseAttributes"><h4>DatabaseAttributes</h4>

	dbAttributes = NSBSystemLib.DatabaseAttributes()

    Description:

	Returns database attributes that were previously retrieved by
	a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbAttributes as Integer
		       The attributes value is a bitmapped value.  The following
		       list contains the bit mask values available:
		           Bit  0  (0x0001) - dmHdrAttrResDB
		           Bit  1  (0x0002) - dmHdrAttrReadOnly
		           Bit  2  (0x0004) - dmHdrAttrAppInfoDirty
		           Bit  3  (0x0008) - dmHdrAttrBackup
		           Bit  4  (0x0010) - dmhdrAttrOKToInstallNewer
		           Bit  5  (0x0020) - dmHdrAttrResetAfterInstall
		           Bit  6  (0x0040) - dmHdrAttrCopyPrevention
		           Bit  7  (0x0080) - dmHdrAttrStream
		           Bit  8  (0x0100) - dmHdrAttrHidden
		           Bit  9  (0x0200) - hmHdrAttrLaunchableData
		           Bit 15  (0x8000) - dmHdrAttrOpen

    Example:

	See the example provided with the DatabaseInfo() function.

<a name="DatabaseVersion"><h4>DatabaseVersion</h4>

	dbVersion = NSBSystemLib.DatabaseVersion()

    Description:

	Returns the database version that was previously retrieved by
	a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbVersion as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

<a name="DatabaseCreationDate"><h4>DatabaseCreationDate</h4>

	dbCreationDate = NSBSystemLib.DatabaseCreationDate()

    Description:

	Returns the database creation date that was previously
	retrieved by a call to DatabaseInfo().  This date is in
	system time format.  It is expressed as the number of seconds
	since January 1st, 1904.

    Parameters:	None

    Returns:	dbCreationDate as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="DatabaseModificationDate"><h4>DatabaseModificationDate</h4>

	dbModificationDate = NSBSystemLib.DatabaseModificationDate()

    Description:

	Returns the database modification date that was previously
	retrieved by a call to DatabaseInfo().  This date is in
	system time format.  It is expressed as the number of seconds
	since January 1st, 1904.

    Parameters:	None

    Returns:	dbModificationDate as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="DatabaseBackupDate"><h4>DatabaseBackupDate</h4>

	dbBackupDate = NSBSystemLib.DatabaseBackupDate()

    Description:

	Returns the database backup date that was previously
	retrieved by a call to DatabaseInfo().  This date is in
	system time format.  It is expressed as the number of seconds
	since January 1st, 1904.

    Parameters:	None

    Returns:	dbBackupDate as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

    Notes:

	See also:  StringDateTime(), StringDate(), StringTime()

<a name="DatabaseModificationNumber"><h4>DatabaseModificationNumber</h4>

	dbModificationNumber = NSBSystemLib.DatabaseModificationNumber()

    Description:

	Returns the database modification number that was previously
	retrieved by a call to DatabaseInfo().  This number is
	incremented every time that a record is added, modified, or
	deleted.

    Parameters:	None

    Returns:	dbModificationNumber as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

<a name="DatabaseAppInfoID"><h4>DatabaseAppInfoID</h4>

	dbAppInfoID = NSBSystemLib.DatabaseAppInfoID()

    Description:

	Returns the LocalID of the database Application Info block
	that was previously retrieved by a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbAppInfoID as Integer
		       0 if this optional block is not available.

    Example:

	See the example provided with the DatabaseInfo() function.

<a name="DatabaseSortInfoID"><h4>DatabaseSortInfoID</h4>

	dbSortInfoID = NSBSystemLib.DatabaseSortInfoID()

    Description:

	Returns the LocalID of the database's sort table
	that was previously retrieved by a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbSortInfoID as Integer
		       0 if this optional sort table is not available.

    Example:

	See the example provided with the DatabaseInfo() function.

<a name="DatabaseType"><h4>DatabaseType</h4>

	dbType = NSBSystemLib.DatabaseType()

    Description:

	Returns the database type that was previously retrieved
	by a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbType as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

    Notes:

	See also:  IntToString4()

<a name="DatabaseCreatorID"><h4>DatabaseCreatorID</h4>

	dbCreatorID = NSBSystemLib.DatabaseCreatorID()

    Description:

	Returns the database Creator ID that was previously retrieved
	by a call to DatabaseInfo().

    Parameters:	None

    Returns:	dbCreatorID as Integer

    Example:

	See the example provided with the DatabaseInfo() function.

    Notes:

	See also:  IntToString4()

<a name="DatabaseTotalSize"><h4>DatabaseTotalSize</h4>

	dbTotalSize = NSBSystemLib.DatabaseTotalSize(cardNo, dbLocalID)

    Description:

	Returns the total database size, including overhead, for
	the specified card number and database LocalID.  It also
	retrieves the number of records and the size of just the
	data in the database.  See the example and notes for
	for more information on how to access this data.

    Parameters:	cardNo as Integer
		dbLocalID as Integer

    Returns:	dbTotalSize as Integer

    Example:

	Dim cardNo as Integer
	Dim dbLocalID as Integer
	Dim dbTotalSize as Integer
	Dim dbNumRecords as Integer
	Dim dbDataSize as Integer
	
	cardNo = 0
	dbName = "NSBRuntime"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	If dbLocalID <> 0 Then
	    dbTotalSize = NSL.DatabaseSize(cardNo, dbLocalID)
	    dbNumRecords = NSL.DatabaseNumRecords()
	    dbDataSize = NSL.DatabaseDataSize()
	EndIf

    Notes:

	 See also:  DatabaseNumRecords(), DatabaseDataSize()

<a name="DatabaseNumRecords"><h4>DatabaseNumRecords</h4>

	dbNumRecords = NSBSystemLib.DatabaseNumRecords()

    Description:

	Returns the number of database records that was previously
	retrieved by a call to DatabaseTotalSize().

    Parameters:	None

    Returns:	dbNumRecords as Integer

    Example:

	See the example provided with the DatabaseTotalSize() function.

<a name="DatabaseDataSize"><h4>DatabaseDataSize</h4>

	dbDataSize = NSBSystemLib.DatabaseDataSize()

    Description:

	Returns the database data size (minus overhead) that was
	previously retrieved by a call to DatabaseTotalSize().

    Parameters:	None

    Returns:	dbDataSize as Integer

    Example:

	See the example provided with the DatabaseTotalSize() function.

<a name="DeleteDatabase"><h4>DeleteDatabase</h4>

	status = NSBSystemLib.DeleteDatabase(cardNo, dbLocalID)

    Description:

	Deletes the specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer

    Returns:	status as Integer
		       0 = successful
		       257 = memErrChunkLocked
		       258 = memErrNotEnoughSpace
		       259 = memErrInvalidParam
		       517 = dmErrDatabaseOpen
		       518 = dmErrCantOpen
		       519 = dmErrCantFind
		       526 = dmErrROMBased

    Example:

	Dim cardNo as Integer
	Dim dbLocalID as Integer
	Dim status as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	If dbLocalID <> 0 Then
	    status = NSL.DeleteDatabase(cardNo, dbLocalID)
	EndIf

    Notes:

	 See also:  FindDatabase()

<a name="GetNextDatabaseByTypeCreator"><h4>GetNextDatabaseByTypeCreator</h4>

	dbLocalID = NSBSystemLib.GetNextDatabaseByTypeCreator(newSearch, dbType, dbCreatorID, onlyLatestVersion)

    Description:

	This function is used to retrieve a list of all the specified
	databases on the device.

    Parameters:	newSearch as Integer
		       0 = continue searching for databases
		       1 = start a new search
		dbType as Integer
		       Integer database type.
		       0 = wildcard search.
		dbCreatorID as Integer
		       Integer Creator ID.
		       0 = wildcard search.
		onlyLatestVersion as Integer
		       0 = return all versions.
		       1 = return only the latest database version for
		           supplied type and Creator ID.

    Returns:	dbLocalID as Integer
		       LocalID of the database.

    Example:

	Dim dbLocalID as Integer
	Dim newSearch as Integer
	Dim dbType as Integer
	Dim dbCreatorID as Integer
	Dim onlyLatestVersion as Integer
	Dim dbCardNo as Integer
	Dim dbName as String
	
	onlyLatestVersion = 0
	dbType = NSL.String4ToInt("libr")
	dbCreatorID = 0
	newSearch = 1
	dbLocalID = 1
	Do While dbLocalID <> 0
	    dbLocalID = NSL.GetNextDatabaseByTypeCreator(newSearch, _
	                          dbType, dbCreatorID, onlyLatestVersion)
	    If dbLocalID <> 0 Then
	        dbCardNo = NSL.DatabaseCardNo()
	        dbName = NSL.DatabaseInfo(dbCardNo, dbLocalID)
	    End If
	    newSearch = 0
	Loop

    Notes:

	See Also:  DatabaseCardNo(), DatabaseInfo()

<a name="DatabaseCardNo"><h4>DatabaseCardNo</h4>

	dbCardNo = NSBSystemLib.DatabaseCardNo()

    Description:

	Returns the database card number that was previously
	retrieved by a call to GetNextDatabaseByTypeCreator().

    Parameters:	None

    Returns:	dbCardNo as Integer

    Example:

	See the example provided with the
	GetNextDatabaseByTypeCreator() function.

<a name="NumDatabases"><h4>NumDatabases</h4>

	nbr = NSBSystemLib.NumDatabases(cardNo)

    Description:

	This function is used to retrieve the number of databases
	on the specified card number.

    Parameter:	cardNo as Integer

    Returns:	nbr as Integer

    Example:

	Dim nbr as Integer
	Dim cardNo as Integer
	
	cardNo = 0
	nbr = NSL.NumDatabases(cardNo)

    Notes:

	This routine is helpful for getting a directory of all
	databases on a card. The function GetDatabase() accepts
	an index from 0 to (NumDatabases -1) and returns a database
	ID by index.
	See also: GetDatabase()

<a name="NumCards"><h4>NumCards</h4>

	nbr = NSBSystemLib.NumCards()

    Description:

	This function returns the number of memory card slots in
	the system. Not all slots need to be populated.

    Parameters:	None

    Returns:	nbr as Integer

    Example:

	Dim nbr as Integer

	nbr = NSL.NumCards()

<a name="GetDatabase"><h4>GetDatabase</h4>

	dbLocalID = NSBSystemLib.GetDatabase(cardNo, index)

    Description:

	This function is used to retrieve a database ID for the
	supplied card number and index.

    Parameters:	cardNo as Integer
		index as Integer

    Returns:	dbLocalID as Integer
		       0 = Invalid index

    Example:

	Dim nbr as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim index as Integer
	Dim dbName as String
	
	cardNo = 0
	nbr = NSL.NumDatabases(cardNo)
	index = 0
	Do While index < nbr
	    dbLocalID = NSL.GetDatabase(cardNo, index)
	    If dbLocalID <> 0 Then
	        dbName = NSL.DatabaseInfo(cardNo, dbLocalID)
	    End If
	    index = index + 1
	Loop

    Notes:

	See also: NumDatabases()

<a name="SetDatabaseName"><h4>SetDatabaseName</h4>

	status = NSBSystemLib.SetDatabaseName(cardNo, dbLocalID, dbName)

    Description:

	This function is used to change the name of the specified
	database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbName as String

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbName as String
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbName = "oldNSBAlarmProxy5"
	status = NSL.SetDatabaseName(cardNo, dbLocalID, dbName)

<a name="SetDatabaseAttributes"><h4>SetDatabaseAttributes</h4>

	status = NSBSystemLib.SetDatabaseAttributes(cardNo, dbLocalID, dbAttributes)

    Description:

	This function is used to change the attributes of the specified
	database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbAttributes as Integer
		       The attributes value is a bitmapped value.  The following
		       list contains the bit mask values available:
		           Bit  0  (0x0001) - dmHdrAttrResDB
		           Bit  1  (0x0002) - dmHdrAttrReadOnly
		           Bit  2  (0x0004) - dmHdrAttrAppInfoDirty
		           Bit  3  (0x0008) - dmHdrAttrBackup
		           Bit  4  (0x0010) - dmhdrAttrOKToInstallNewer
		           Bit  5  (0x0020) - dmHdrAttrResetAfterInstall
		           Bit  6  (0x0040) - dmHdrAttrCopyPrevention
		           Bit  7  (0x0080) - dmHdrAttrStream
		           Bit  8  (0x0100) - dmHdrAttrHidden
		           Bit  9  (0x0200) - hmHdrAttrLaunchableData
		           Bit 15  (0x8000) - dmHdrAttrOpen

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbAttributes as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbAttributes = 2
	status = NSL.SetDatabaseAttributes(cardNo, dbLocalID, dbAttributes)

<a name="SetDatabaseVersion"><h4>SetDatabaseVersion</h4>

	status = NSBSystemLib.SetDatabaseVersion(cardNo, dbLocalID, dbVersion)

    Description:

	This function is used to change the version number of the
	specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbVersion as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbVersion as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbVersion = 6
	status = NSL.SetDatabaseVersion(cardNo, dbLocalID, dbVersion)

<a name="SetDatabaseCreationDate"><h4>SetDatabaseCreationDate</h4>

	status = NSBSystemLib.SetDatabaseCreationDate(cardNo, dbLocalID, dbCreationDate)

    Description:

	This function is used to change the creation date of the
	specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbCreationDate as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbCreationDate as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbCreationDate = NSL.SystemTime("", "", 0, 0)
	status = NSL.SetDatabaseCreationDate(cardNo, dbLocalID, _
	                                    dbCreationDate)

<a name="SetDatabaseModificationDate"><h4>SetDatabaseModificationDate</h4>

	status = NSBSystemLib.SetDatabaseModificationDate(cardNo, dbLocalID, dbModificationDate)

    Description:

	This function is used to change the modification date of the
	specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbModificationDate as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbModificationDate as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbModificationDate = NSL.SystemTime("", "", 0, 0)
	status = NSL.SetDatabaseModificationDate(cardNo, dbLocalID, _
	                                        dbModificationDate)

<a name="SetDatabaseBackupDate"><h4>SetDatabaseBackupDate</h4>

	status = NSBSystemLib.SetDatabaseBackupDate(cardNo, dbLocalID, dbBackupDate)

    Description:

	This function is used to change the backup date of the
	specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbBackupDate as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbBackupDate as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbBackupDate = NSL.SystemTime("", "", 0, 0)
	status = NSL.SetDatabaseModificationDate(cardNo, dbLocalID, _
	                                        dbBackupDate)

<a name="SetDatabaseModificationNumber"><h4>SetDatabaseModificationNumber</h4>

	status = NSBSystemLib.SetDatabaseModificationNumber(cardNo, dbLocalID, dbModificationNumber)

    Description:

	This function is used to change the modification number of
	the specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbModificationNumber as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbModificationNumber as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbModificationNumber = 0
	status = NSL.SetDatabaseModificationNumber(cardNo, dbLocalID, _
	                                          dbModificationNumber)

<a name="SetDatabaseAppInfoID"><h4>SetDatabaseAppInfoID</h4>

	status = NSBSystemLib.SetDatabaseAppInfoID(cardNo, dbLocalID, dbAppInfoID)

    Description:

	This function is used to change the Application Information
	LocalID of the specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbAppInfoID as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbAppInfoID as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbAppInfoID = 0
	status = NSL.SetDatabaseAppInfoID(cardNo, dbLocalID, _
	                                 dbAppInfoID)

<a name="SetDatabaseSortInfoID"><h4>SetDatabaseSortInfoID</h4>

	status = NSBSystemLib.SetDatabaseSortInfoID(cardNo, dbLocalID, dbSortInfoID)

    Description:

	This function is used to change the Sort Table LocalID of
	the specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbSortInfoID as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbSortInfoID as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbSortInfoID = 0
	status = NSL.SetDatabaseSortInfoID(cardNo, dbLocalID, _
	                                 dbSortInfoID)

<a name="SetDatabaseType"><h4>SetDatabaseType</h4>

	status = NSBSystemLib.SetDatabaseType(cardNo, dbLocalID, dbType)

    Description:

	This function is used to change the database type of the
	specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbType as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbType as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbType = String4ToInt("appl")
	status = NSL.SetDatabaseType(cardNo, dbLocalID, dbType);

<a name="SetDatabaseCreatorID"><h4>SetDatabaseCreatorID</h4>

	status = NSBSystemLib.SetDatabaseCreatorID(cardNo, dbLocalID, dbCreatorID)

    Description:

	This function is used to change the Creator ID of the
	specified database.

    Parameters:	cardNo as Integer
		dbLocalID as Integer
		dbCreatorID as Integer

    Returns:	status as Integer
		       0 = success
		       515 = dmErrInvalidParam
		       537 = dmErrAlreadyExists
		       538 = InvalidDatabaseName

    Example:

	Dim status as Integer
	Dim dbLocalID as Integer
	Dim cardNo as Integer
	Dim dbCreatorID as Integer
	
	cardNo = 0
	dbName = "NSBAlarmProxy5"
	dbLocalID = NSL.FindDatabase(cardNo, dbName)
	dbCreatorID = String4ToInt("TEST")
	status = NSL.SetDatabaseCreatorID(cardNo, dbLocalID, dbCreatorID);

<h3>Event Functions:</h3>

<a name="GetEvent"><h4>GetEvent</h4>

	eventType = NSBSystemLib.GetEvent(timeoutTicks, consumePenEvents, returnVirtualEvents)

    Description:

	Returns an system event type, if one is available.  The
	timeoutTicks parameter is used to provide a "non-blocking"
	delay.  If an event occurs before the timeout period expires
	the function will return immediately.  This can be useful
	for use with animation or game programming.

    Parameters:	timeoutTicks as Integer
		       The number of system ticks to wait before
		       		returning.
		consumePenEvents as Integer
		       0 = do not consume pen events
		       1 = consume pen events
		         This function calls the PalmOS EvtGetEvent function.
		         EvtGetEvent removes events from the events queue.  In
		         order for these events to still be available for other
		         processing, this shared library function requeues the
		         events that it detects.  This may not be desired if
		         this function is used for capturing pen events for
		         drawing.  When consumePenEvents is set to 1, the pen
		         events are not requeued but the pen data is still
		         available.
		returnVirtualEvents as Integer
		       0 = do not return with virtual key events
		       1 = return with virtual key events
		         Virtual key events are events generated by the PalmOS
		         system or other third party system level features.
		         These events include things like low battery warning,
		         backlight change of state, etc.  For the most part,
		         virtual key events should not be returned.  If they
		         are returned, it is probably wise to let the system
		         handle them by calling this library's SysHandleEvent()
		         function.

    Returns:	eventType as Integer
		       -1 if no event was available within the
		       		timeout specified.
		       0 = nilEvent
		       1 = penDownEvent
		             Retrieve pen coordintates with:
		                 GlobalX(), and GlobalY()
		       2 = penUpEvent
		             Retrieve pen coordintates with:
		                 GlobalX(), GlobalY()
		             Retrieve pen stroke coordinates with:
		                 GlobalStartX(), GlobalStartY(),
		                 GlobalEndX(), and GlobalEndY()
		       3 = penMoveEvent
		             Retrieve pen coordintates with:
		                 GlobalX(), and GlobalY()
		       4 = keyDownEvent
		             Retrieve key data with:
		                 KeyEventChr(), KeyEventKeyCode(),
		                 and KeyEventModifiers()
		       5 = winEnterEvent
		       6 = winExitEvent
		       7 = ctlEnterEvent
		       8 = ctlExitEvent
		       9 = ctlSelectEvent
		       10 = ctlRepeatEvent
		       11 = lstEnterEvent
		       12 = lstSelectEvent
		       13 = lstExitEvent
		       14 = popSelectEvent
		       15 = fldEnterEvent
		       16 = fldHeightChangedEvent
		       17 = fldChangedEvent
		       18 = tblEnterEvent
		       19 = tblSelectEvent
		       20 = daySelectEvent
		       21 = menuEvent
		       22 = appStopEvent
		       21 = frmOpenEvent
		       22 = frmGotoEvent
		       23 = frmUpdateEvent
		       24 = frmSaveEvent
		       25 = frmCloseEvent
		       26 = frmTitleEnterEvent
		       27 = frmTitleSelectEvent
		       28 = tblExitEvent
		       29 = sclEnterEvent
		       30 = sclExitEvent
		       31 = sclRepeatEvent
		       35 = tsmConfirmEvent
		       36 = tsmFepButtonEvent
		       37 = tsmFepModeEvent
		       
		       2048 = menuCmdBarOpenEvent
		       2049 = menuOpenEvent
		       2050 = menuCloseEvent
		       2051 = frmGadgetEnterEvent
		       2052 = frmGadgetMiscEvent
		       
		       4096 = firstINetLibEvent
		       4352 = firstWebLibEvent
		       
		       24576 = firstUserEvent

    Example:

	Dim eventType as Integer
	Dim timeoutTicks as Integer
	
	NSL.FlushEvents()
	eventType = 0
	Do While eventType <= 0
	    'do something
	    eventType = NSL.GetEvent(timeoutTicks, 0, 0)
	Loop

    Notes:

	If this function is used as part of a button's event code,
	you may want to flush pending key and pen events before
	calling this function.  This is because the "pen up" event
	resulting from the button push will cause this function to
	to return immediately.  See the example and FlushEvents()
	function.
	

<a name="SysHandleEvent"><h4>SysHandleEvent</h4>

	NSBSystemLib.SysHandleEvent()

    Description:

	Consume and handle the event most recently returned
	by the GetEvent() function.  It does this by calling
	EvtGetEvent() and then SysHandleEvent();

    Parameters:	None

    Returns:	None

    Example:

	NSL.SysHandleEvent()

<a name="FlushEvents"><h4>FlushEvents</h4>

	NSBSystemLib.FlushEvents()

    Description:

	Flushes all pending key and pen events.  It does this by
	calling the PalmOS EvtFlushKeyQueue() and
	EvtFlushPenQueue() functions.  It then empties and handles
	all remaing events by calling EvtGetEvent() and
	SysHandleEvent().

    Parameters:	None

    Returns:	None

    Example:

	NSL.FlushEvents()

<a name="KeyEventChr"><h4>KeyEventChr</h4>

	keyChr = NSBSystemLib.KeyEventChr()

    Description:

	Returns the "chr" data member of of a key event.  The
	GetEvent() function must have returned an event type of
	4 (keyDownEvent) for this value to be valid.

    Parameters:	None

    Returns:	keyChr as Integer

    Example:

	Dim keyChr as Integer

	keyChr = NSL.KeyEventChr()

<a name="KeyEventKeyCode"><h4>KeyEventKeyCode</h4>

	keyCode = NSBSystemLib.KeyEventKeyCode()

    Description:

	Returns the "keyCode" data member of of a key event.  The
	GetEvent() function must have returned an event type of
	4 (keyDownEvent) for this value to be valid.

    Parameters:	None

    Returns:	keyCode as Integer

    Example:

	Dim keyCode as Integer

	keyCode = NSL.KeyEventKeyCode()

<a name="KeyEventModifiers"><h4>KeyEventModifiers</h4>

	modifiers = NSBSystemLib.KeyEventModifiers()

    Description:

	Returns the "modifiers" data member of of a key event.  The
	GetEvent() function must have returned an event type of
	4 (keyDownEvent) for this value to be valid.

    Parameters:	None

    Returns:	modifiers as Integer

    Example:

	Dim modifiers as Integer

	modifiers = NSL.KeyEventModifiers()

<h3>Field and Form Functions:</h3>

<a name="ControlHitControl"><h4>ControlHitControl</h4>

	NSBSystemLib.ControlHitControl objID

    Description:

	Simulate tapping a control. This function adds a
	ctlSelectEvent to the event queue.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	None

    Example:

	Dim objID as Integer
	
	objID = 1008
	NSL.ControlHitControl objID

<a name="FieldCopy"><h4>FieldCopy</h4>

	NSBSystemLib.FieldCopy objID

    Description:

	Copy the current selection to the text clipboard.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	None

    Example:

	Dim objID as Integer
	
	objID = 1008
	NSL.FieldCopy objID

<a name="FieldCut"><h4>FieldCut</h4>

	NSBSystemLib.FieldCut objID

    Description:

	Copy the current selection to the text clipboard, delete
	the selection from the field, and redraw the field.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	None

    Example:

	Dim objID as Integer
	
	objID = 1008
	NSL.FieldCut objID

<a name="FieldInsert"><h4>FieldInsert</h4>

	NSBSystemLib.FieldInsert objID, insString

    Description:

	Replace the current selection if any with the specified
	string and redraw the field.

    Parameters:	objID as Integer
		       0 = use field that currently has focus
		insString as String

    Returns:	None

    Example:

	Dim objID as Integer
	Dim insString as String
	
	objID = 1008
	insString = "Insert This!"
	NSL.FieldInsert objID, insString

<a name="FieldPaste"><h4>FieldPaste</h4>

	NSBSystemLib.FieldPaste objID

    Description:

	Replace the current selection in the field, if any, with the
	contents of the text clipboard.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	None

    Example:

	Dim objID as Integer
	
	objID = 1008
	NSL.FieldPaste objID

<a name="FieldUndo"><h4>FieldUndo</h4>

	NSBSystemLib.FieldUndo objID

    Description:

	Undo the last change made to the field object, if any.
	Changes include paste and cut.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	None

    Example:

	Dim objID as Integer
	
	objID = 1008
	NSL.FieldUndo objID

<a name="FieldGetInsPtPosition"><h4>FieldGetInsPtPosition</h4>

	pos = NSBSystemLib.FieldGetInsPtPosition(objID)

    Description:

	Returns the insertion point position within the string.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	pos as Integer

    Example:

	Dim pos as Integer
	Dim objID as Integer
	
	objID = 1008
	pos = NSL.FieldGetInsPtPosition(objID)

    Notes:

	The insertion point is to the left of the byte offset that
	this function returns. That is, if this function returns 0,
	the insertion point is to the left of the first character
	in the string. In multiline fields, line feeds are counted
	as a single character in the string, and the byte offset
	after the line feed character is the beginning of the next
	line.
	See also: FieldSetInsertionPoint() and FieldSetInsPtPosition()

<a name="FieldGetSelection"><h4>FieldGetSelection</h4>

	startPos = NSBSystemLib.FieldGetSelection(objID)

    Description:

	Retrieves the start and end position of a field's selected
	text.  It only returns the start position.  To get the end
	position, use the GlobalEndPos() funtion.

    Parameter:	objID as Integer
		       0 = use field that currently has focus

    Returns:	startPos as Integer

    Example:

	Dim startPos as Integer
	Dim objID as Integer
	Dim endPos as Integer
	
	objID = 1008
	startPos = NSL.FieldGetSelection(objID)
	endPos = NSL.GlobalEndPos()

<a name="FieldAnyDirty"><h4>FieldAnyDirty</h4>

	dirty = NSBSystemLib.FieldAnyDirty()

    Description:

	Returns 1 if one or more of the active form's field values
	have changed since the last time that they were set.

    Parameters:	None

    Returns:	dirty as Integer

    Example:

	Dim dirty as Integer

	dirty = NSL.FieldAnyDirty()

<a name="FieldDirty"><h4>FieldDirty</h4>

	dirty = NSBSystemLib.FieldDirty(objID)

    Description:

	Returns 1 if the field's value has changed since the last
	time that it was set.

    Parameter:	objID as Integer
		       0 = check field that currently has focus

    Returns:	dirty as Integer

    Example:

	Dim dirty as Integer
	Dim objID as Integer
	
	objID = 1008
	dirty = NSL.FieldDirty(objID)

<a name="FieldSetDirty"><h4>FieldSetDirty</h4>

	NSBSystemLib.FieldSetDirty objID, dirty

    Description:

	Sets a field's "dirty" property.  A field is considered as
	dirty if its value has changed since the last time it was
	set.

    Parameters:	objID as Integer
		       0 = use field that currently has focus
		dirty as Integer
		       0 = not dirty
		       1 = dirty

    Returns:	None

    Example:

	Dim objID as Integer
	Dim dirty as Integer
	
	objID = 1008
	dirty = 1
	NSL.FieldSetDirty objID, dirty

<a name="FieldSetAllDirty"><h4>FieldSetAllDirty</h4>

	NSBSystemLib.FieldSetAllDirty dirty

    Description:

	Sets the "dirty" property of all of the active form's field
	values.

    Parameter:	dirty as Integer
		       0 = not dirty
		       1 = dirty

    Returns:	None

    Example:

	Dim dirty as Integer

	NSL.FieldSetAllDirty dirty

<a name="FieldSetSelection"><h4>FieldSetSelection</h4>

	NSBSystemLib.FieldSetSelection objID, startPos, endPos

    Description:

	Set the current selection in a field and highlight the
	selection if the field is visible.

    Parameters:	objID as Integer
		       0 = use field that currently has focus
		startPos as Integer
		endPos as Integer

    Returns:	None

    Example:

	Dim objID as Integer
	Dim startPos as Integer
	Dim endPos as Integer
	
	objID = 1008
	NSL.FieldSetSelection objID, startPos, endPos

<a name="FieldSetInsertionPoint"><h4>FieldSetInsertionPoint</h4>

	NSBSystemLib.FieldSetInsertionPoint objID, pos

    Description:

	Set the location of the insertion point based on a
	specified string position.

    Parameters:	objID as Integer
		       0 = use field that currently has focus
		pos as Integer

    Returns:	None

    Example:

	Dim objID as Integer
	Dim pos as Integer
	
	objID = 1008
	NSL.FieldSetInsertionPoint objID, pos

    Notes:

	This routine differs from FieldldSetInsPtPosition in
	that it doesn't make the character position visible.
	FieldSetInsertionPoint also doesn't make the field the
	current focus of input if it was not already.
	See Also:  FieldSetInsPtPosition() and FieldGetInsPtPosition()

<a name="FieldSetInsPtPosition"><h4>FieldSetInsPtPosition</h4>

	NSBSystemLib.FieldSetInsPtPosition objID, pos

    Description:

	Set the location of the insertion point based on a
	specified string position.

    Parameters:	objID as Integer
		       0 = use field that currently has focus
		pos as Integer

    Returns:	None

    Example:

	Dim objID as Integer
	Dim pos as Integer
	
	objID = 1008
	NSL.FieldSetInsPtPosition objID, pos

    Notes:

	If the position is beyond the visible text, the field is
	scrolled until the position is visible.
	See also:  FieldSetInsertionPoint() and FieldGetInsPtPosition()

<a name="FormGetNumberOfObjects"><h4>FormGetNumberOfObjects</h4>

	nbr = NSBSystemLib.FormGetNumberOfObjects()

    Description:

	Retrieves the number of objects on the active form.

    Parameters:	None

    Returns:	nbr as Integer
		       -1 if no form is active

    Example:

	Dim nbr as Integer

	nbr = NSL.FormGetNumberOfObjects()

<a name="FormGetObjectBounds"><h4>FormGetObjectBounds</h4>

	x = NSBSystemLib.FormGetObjectBounds(objID)

    Description:

	Retrieves the x, y, width, and height values of a form
	object.

    Parameter:	objID as Integer
		       0 = use object that currently has focus

    Returns:	x as Integer
		       -1 if the object is invalid or no object has focus

    Example:

	Dim x as Integer
	Dim objID as Integer
	Dim y as Integer
	Dim width as Integer
	Dim height as Integer
	
	objID = 1008
	x = NSL.FormGetObjectBounds(objID)
	y = NSL.GlobalY()
	width = NSL.GlobalWidth()
	height = NSL.GlobalHeight()

    Notes:

	This function only returns the x position.  Use
	the GlobalY(), GlobalWidth(), and GlobalHeight() functions
	to retrieve the other values.

<a name="FormGetObjectPosition"><h4>FormGetObjectPosition</h4>

	x = NSBSystemLib.FormGetObjectPosition(objID)

    Description:

	Retrieves the starting X and Y position values of a form
	object.

    Parameter:	objID as Integer
		       0 = use object that currently has focus

    Returns:	x as Integer
		       -1 if the object is invalid or no object has focus

    Example:

	Dim x as Integer
	Dim objID as Integer
	Dim y as Integer
	
	objID = 1008
	x = NSL.FormGetObjectPosition(objID)
	y = NSL.GlobalY

    Notes:

	This function only returns the X position.  Use the
	GlobalY(), function to retrieve the Y position.

<a name="FormGetObjectType"><h4>FormGetObjectType</h4>

	type = NSBSystemLib.FormGetObjectType(objID)

    Description:

	Retrieves the object type of the specified object.

    Parameter:	objID as Integer
		       0 = use object that currently has focus

    Returns:	type as Integer
		       -1 if the object is invalid or no object has focus
		        0 = frmFieldObj
		        1 = frmControlObj
		        2 = frmListObj
		        3 = frmTableObj
		        4 = frmBitmapObj
		        5 = frmLineObj
		        6 = frmFrameObj
		        7 = frmRectangleObj
		        8 = frmLabelObj
		        9 = frmTitleObj
		       10 = frmPopupObj
		       11 = frmGraffitiStateObj
		       12 = frmGadgetObj
		       13 = frmScrollbarObj

    Example:

	Dim type as Integer
	Dim objID as Integer
	objID = 1008
	type = NSL.FormGetObjectType(objID)

<a name="FormSetObjectPosition"><h4>FormSetObjectPosition</h4>

	NSBSystemLib.FormSetObjectPosition objID, x, y

    Description:

	Changes an object's current position.

    Parameters:	objID as Integer
		       0 = use object that currently has focus
		x as Integer
		y as Integer

    Returns:	None

    Example:

	Dim objID as Integer
	Dim x as Integer
	Dim y as Integer
	
	objID = 1008
	x = 120
	y = 40
	NSL.FormSetObjectPosition objID, x, y

<h3>Preference Functions:</h3>

<a name="GetAppPreferences"><h4>GetAppPreferences</h4>

	data = NSBSystemLib.GetAppPreferences(pgmName, prefId, saved)

    Description:

	Get an application preference string.

    Parameters:	pgmName as String
		       Program Name - This is case sensitive
		prefId as Integer
		       Preference ID
		saved as Integer
		       0 = preference does not get restored after a hard reset
		       1 = preference does get restored after a hard reset

    Returns:	data as String

    Example:

	Dim data as String
	Dim pgmName as String
	Dim prefId as Integer
	Dim saved as Integer
	
	pgmName = "SysLibTest"
	prefId = 1
	saved = 0
	data = NSL.GetAppPreferences(pgmName, prefId, saved)

    Notes:

	Currently preference strings are limited to 250 bytes or
	less.

<a name="SetAppPreferences"><h4>SetAppPreferences</h4>

	status = NSBSystemLib.SetAppPreferences(pgmName, prefId, data, saved)

    Description:

	Set an application preference string.

    Parameters:	pgmName as String
		       Program Name - This is case sensitive
		prefId as Integer
		       Preference ID
		data as String
		       0 = preference does not get restored after a hard reset
		       1 = preference does get restored after a hard reset
		saved as Integer

    Returns:	status as Integer

    Example:

	Dim status as Integer
	Dim pgmName as String
	Dim prefId as Integer
	Dim data as String
	Dim saved as Integer
	
	pgmName = "SysLibTest"
	prefId = 1
	data = "anything I want!"
	saved = 0
	status = NSL.SetAppPreferences(pgmName, prefId, data, saved)

    Notes:

	Currently preference strings are limited to 250 bytes or
	less.

<a name="GetSysPreference"><h4>GetSysPreference</h4>

	data = NSBSystemLib.GetSysPreference(prefID)

    Description:

	Get the value of a system preference.

    Parameter:	prefID as Integer
		       Preference ID - see SystemPreferencesChoice enum in
		                       Preferences.h

    Returns:	data as Integer

    Example:

	Dim data as Integer
	Dim prefID as Integer
	
	prefID = 7   'prefAutoOffDuration - in seconds
	data = NSL.GetSysPreference(prefID)

<a name="SetSysPreference"><h4>SetSysPreference</h4>

	NSBSystemLib.SetSysPreference prefID, data

    Description:

	Set the value of a system preference.

    Parameters:	prefID as Integer
		       Preference ID - see SystemPreferencesChoice enum in
		                       Preferences.h
		data as Integer

    Returns:	None

    Example:

	Dim prefID as Integer
	Dim data as Integer
	
	prefID = 7   'prefAutoOffDuration - in seconds
	data = 300   '5 minutes
	NSL.SetSysPreference prefID, data

<h3>Progress Manager Functions:</h3>

<a name="ProgressStartDialog"><h4>ProgressStartDialog</h4>

	NSBSystemLib.ProgressStartDialog title

    Description:

	Start a Progress Dialog.  The Progress Dialog functions are
	used to display a special type of alert that informs the user
	of the progress being made during operations that take a long
	time.

    Parameter:	title as String
		       must be 20 characters or less.

    Returns:	None

    Example:

	Dim title as String
	Dim message as String
	Dim stage as Integer
	Dim error as Integer
	Dim force as Integer
	Dim canceled as Integer
	Dim strValue as String
	Dim resolution as Integer
	Dim completeChar as String
	Dim incompleteChar as String
	Dim percent as Integer
	Dim count as Integer
	
	completeChar = "|"
	incompleteChar = "."
	resolution = 5
	count = 100
	
	title = "Progress Test..."
	NSL.ProgressStartDialog title
	Delay 1
	error = 0
	stage = 1
	Do While stage <= count
	    canceled = NSL.ProgressUserCancel()
	    If canceled = 1 Then
	        Exit Do
	    End If
	    percent = NSL.ProgressPercent(stage, count)
	    strValue = NSL.ProgressPercentString(percent, resolution, _
	                                         completeChar, incompleteChar)
	    Message = strValue + Chr(10) + Str(percent) _
	            + "% complete" + Chr(10) _
	            + "stage = " + Str(stage)
	    NSL.ProgressUpdateDialog error, message
	    stage = stage + 1
	    Delay 0.25
	Loop
	
	force = 0
	Delay 1
	NSL.ProgressStopDialog(force)

    Notes:

	 See also:  ProgressStopDialog(), ProgressUpdateDialog()

<a name="ProgressStopDialog"><h4>ProgressStopDialog</h4>

	NSBSystemLib.ProgressStopDialog force

    Description:

	Stops a Progress Dialog.  This function must be called to
	make the dialog disappear.

    Parameter:	force as Integer
		       0 = do not force an immediate exit of the dialog
		       1 = force an immediate exit of the dialog
		           This parameter only has meaning if the dialog is
		           in the process of displaying an error message.  If
		           "force" is set to 0, then the user must press the
		           "OK" button on the dialog before the dialog disappears.

    Returns:	None

    Example:

	See the example provided with ProgressStartDialog()

<a name="ProgressUpdateDialog"><h4>ProgressUpdateDialog</h4>

	NSBSystemLib.ProgressUpdateDialog error, message

    Description:

	Update the message that is displayed in the Progress Dialog.

    Parameters:	error as Integer
		       0 = no error
		       1 = use error processing
		           if "error" is set to 1, the dialog will display the
		           specified message and only present one button - "OK".
		message as String
		       Message string to display.  This string must be less than
		       128 characters in length.

    Returns:	None

    Example:

	See the example provided with ProgressStartDialog().

<a name="ProgressUserCancel"><h4>ProgressUserCancel</h4>

	canceled = NSBSystemLib.ProgressUserCancel()

    Description:

	Returns 1 if the user pressed the "Cancel" button on the
	Progress dialog.  If you have an operation that should not
	or can not be canceled, then do not call this function.
	The "Cancel" button will still be present, but it will not
	do anything.  Currently, with PalmOS, this button can not
	be made invisible or grayed out.

    Parameters:	None

    Returns:	canceled as Integer

    Example:

	See the example provided with ProgressStartDialog().

<a name="ProgressPercent"><h4>ProgressPercent</h4>

	percent = NSBSystemLib.ProgressPercent(current, count)

    Description:

	Calculates a percentage complete number based on the
	input values.  This function is not really part of the
	Progress Manager API.  It is just provided as a convenient
	way to calculate a percentage complete value that can be
	included in your Progress Dialog message.

    Parameters:	current as Integer
		       Current iteration number of your process loop.
		count as Integer
		       Number of iterations required to be 100 percent complete.

    Returns:	percent as Integer

    Example:

	See the example provided with ProgressStartDialog().

<a name="ProgressPercentString"><h4>ProgressPercentString</h4>

	strValue = NSBSystemLib.ProgressPercentString(percent, resolution, completeChar, incompleteChar)

    Description:

	Constructs a string with characters representing the
	percentage complete and incomplete for your process loop.
	This function is not really part of the Progress Manager
	API.  It is just provided as a convenient way to display
	a crude "graphic" representation of your loop's progress.
	This string can be included as part of your Progress Dialog
	message.

    Parameters:	percent as Integer
		       Percent complete - see also ProgressPercent().
		resolution as Integer
		       The resolution size of the percent string.
		         A resolution of 1 means that there will be 100
		         characters in the percent string.  Every 1% change
		         will be reflected in the percent string.  A
		         resolution of 5 means that there will be 20
		         characters in the percent string.  Every 5% change
		         will be reflected in the percent string.
		         As you can see, the total length of the percent
		         string is calculated as (100 / resolution).  As such,
		         resolution values should be one of the following:
		             1, 2, 4, 5, 10, 20, 25, or 50
		completeChar as String
		       The character to display for the percent completed.
		           "|" is recommended.
		incompleteChar as String
		       The character to display for the percent incomplete.
		           "." is recommended.
		         The "completeChar" and "incompleteChar" characters
		         should probably be characters with the exact same
		         pixel width.  Otherwise, the percent string display
		         width will vary as the percentage complete changes.

    Returns:	strValue as String

    Example:

	See the example provided with ProgressStartDialog().

<h3>System Time Functions:</h3>

<a name="SelectOneTime"><h4>SelectOneTime</h4>

	newTimeSelected = NSBSystemLib.SelectOneTime(defHour, defMinute, title)

    Description:

	Calls the SelectOneTime() PalmOS function to display a dialog
	that allows a user to select 1 time value.  This function
	returns 1 if a newTime was selected, otherwise it returns 0.
	use the GlobalHour() and GlobalMinute() functions to retrieve
	selected time values.

    Parameters:	defHour as Integer
		       Default hour for selection
		defMinute as Integer
		       Default minute for selection
		title as String

    Returns:	newTimeSelected as Integer

    Example:

	Dim newTimeSelected as Integer
	Dim defHour as Integer
	Dim defMinute as Integer
	Dim title as String
	
	defHour = 10
	defMinute = 30
	title = "Some Title"
	newTimeSelected = NSL.SelectOneTime(defHour, defMinute, title)
	If newTimeSelected = 1 Then
	    defHour = NSL.GlobalHour()
	    defMinute = NSL.GlobalMinute()
	End If

<a name="IncrementSystemTime"><h4>IncrementSystemTime</h4>

	newSysTime = NSBSystemLib.IncrementSystemTime(oldSysTime, hours, minutes, seconds)

    Description:

	Returns a system time value that is incremented by the
	specified number of hours, minutes, and seconds.  A system
	time value is an integer that is expressed as the number of
	seconds since January 1st, 1904.

    Parameters:	oldSysTime as Integer
		       0 = use current system time.
		hours as Integer
		minutes as Integer
		seconds as Integer

    Returns:	newSysTime as Integer

    Example:

	Dim newSysTime as Integer
	Dim oldSysTime as Integer
	Dim hours as Integer
	Dim minutes as Integer
	Dim seconds as Integer
	
	oldSysTime = 0
	hours = 0
	minutes = 30
	seconds = 0
	'Add 30 minutes
	newSysTime = NSL.IncrementSystemTime(oldSysTime, hours, minutes, seconds)

<a name="SystemTime"><h4>SystemTime</h4>

	sysTime = NSBSystemLib.SystemTime(strDate, strTime, seconds, ToDateFormat)

    Description:

	Returns a "System Time" value.  This value is expressed as
	the number of seconds since January 1st, 1904.  The time to
	return is supplied as strings in the strDate and strTime
	parameters.  The strDate parameter may contain only a date
	value or both a date and a time value.  If the strTime
	parameter is blank (""), the time, if specified, in the
	strDate parameter will be used.  If both the strDate and the
	strTime parameters are blank, the current system time will
	be used. The additional seconds parameter is used to provide
	an easy way to increment or decrement the returned system time.
	For example:
	    systemTime = NSL.SystemTime("", "", 5, 0)
	returns the current time plus 5 seconds.

    Parameters:	strDate as String
		       See the ToDateFormat parameter for date string formats.
		strTime as String
		       The time string is specified as: "HH[:MM[:SS]][AM|PM|am|pm]"
		       (actually, if the character 'P' or 'p' is present, the time
		        will be interpreted as AM/PM format and the hour will be
		        appropriately adjusted).
		seconds as Integer
		       Increment (or decrement, if negative) the returned systemTime
		       by the specified number of seconds.
		ToDateFormat as Integer
		       0 = strDate string is in MM/DD/YYYY or MM/DD/YY format.
		       1 = strDate string is in YYYY/MM/DD or YY/MM/DD format.

    Returns:	sysTime as Integer
		       Integer time as expressed as the number of seconds since
		       January 1st, 1904.

    Example:

	Dim sysTime as Integer
	Dim strDate as String
	Dim strTime as String
	Dim seconds as Integer
	Dim ToDateFormat as Integer
	
	strDate = ""
	strTime = ""
	Seconds = 5
	ToDateFormat = 0
	sysTime = NSL.SystemTime(strDate, strTime, seconds, ToDateFormat)

    Notes:

	See also:  StringDateTime(), StringDate(), and StringTime()

<a name="StringDateTime"><h4>StringDateTime</h4>

	strDateTime = NSBSystemLib.StringDateTime(sysTime, ToDateFormat, ToTimeFormat, AMPMFormat)

    Description:

	Returns a string representation of the supplied "System Time"
	value.  The sysTime value is an integer value expressed
	as the number of seconds since January 1st, 1904.  The
	returned value is a string containing both the date and time.
	If the sysTime parameter is specified as 0, the current system
	date and time will be returned.

    Parameters:	sysTime as Integer
		       Integer time as expressed as the number of seconds since
		       January 1st, 1904.
		ToDateFormat as Integer
		       0 = the date string will be in MM/DD/YYYY or MM/DD/YY format.
		       1 = the date string will be in YYYY/MM/DD or YY/MM/DD format.
		ToTimeFormat as Integer
		       0 = the time string will be in HH:MM format.
		       1 = the time string will be in HH:MM:SS format.
		AMPMFormat as Integer
		       0 = no AM/PM indicators will be added.
		       1 = " AM" or " PM" indicator will be added and the hour will
		           will be adjusted appropriately.

    Returns:	strDateTime as String

    Example:

	Dim strDateTime as String
	Dim sysTime as Integer
	Dim ToDateFormat as Integer
	Dim ToTimeFormat as Integer
	Dim AMPMFormat as Integer
	
	sysTime = SystemTime("", "", 0, 0)
	strDateTime = NSL.StringDateTime(sysTime, ToDateFormat, ToTimeFormat, AMPMFormat)

    Notes:

	See also:  SystemTime(), StringDate(), and StringTime()

<a name="StringDate"><h4>StringDate</h4>

	strDate = NSBSystemLib.StringDate(sysTime, ToDateFormat)

    Description:

	Returns a string representation of the supplied "System Time"
	value.  The sysTime value is an integer value expressed
	as the number of seconds since January 1st, 1904.  The
	returned value is a string containing only the date.
	If the sysTime parameter is specified as 0, the current system
	date will be returned.

    Parameters:	sysTime as Integer
		       Integer time as expressed as the number of seconds since
		       January 1st, 1904.
		ToDateFormat as Integer
		       0 = the date string will be in MM/DD/YYYY or MM/DD/YY format.
		       1 = the date string will be in YYYY/MM/DD or YY/MM/DD format.

    Returns:	strDate as String

    Example:

	Dim strDate as String
	Dim sysTime as Integer
	Dim ToDateFormat as Integer
	
	sysTime = SystemTime("", "", 0, 0)
	strDate = NSL.StringDate(sysTime, ToDateFormat)

    Notes:

	See also:  SystemTime(), StringDateTime(), and StringTime()

<a name="StringTime"><h4>StringTime</h4>

	strTime = NSBSystemLib.StringTime(sysTime, ToTimeFormat, AMPMFormat)

    Description:

	Returns a string representation of the supplied "System Time"
	value.  The sysTime value is an integer value expressed
	as the number of seconds since January 1st, 1904.  The
	returned value is a string containing only the time.
	If the sysTime parameter is specified as 0, the current system
	time will be returned.

    Parameters:	sysTime as Integer
		       Integer time as expressed as the number of seconds since
		       January 1st, 1904.
		ToTimeFormat as Integer
		       0 = the time string will be in HH:MM format.
		       1 = the time string will be in HH:MM:SS format.
		AMPMFormat as Integer
		       0 = no AM/PM indicators will be added.
		       1 = " AM" or " PM" indicator will be added and the hour will
		           will be adjusted appropriately.

    Returns:	strTime as String

    Example:

	Dim strTime as String
	Dim sysTime as Integer
	Dim ToTimeFormat as Integer
	Dim AMPMFormat as Integer
	
	sysTime = SystemTime("", "", 0, 0)
	strTime = NSL.StringTime(sysTime, ToTimeFormat, AMPMFormat)

    Notes:

	See also:  SystemTime(), StringDateTime(), and StringDate()

<h3>Screen and Color Functions:</h3>

<a name="GetSupportedDepths"><h4>GetSupportedDepths</h4>

	depths = NSBSystemLib.GetSupportedDepths()

    Description:

	Returns a bitmapped integer with each bit indicating a
	bitmap depth supported by the PalmOS device.

    Parameters:	None

    Returns:	depths as Integer

    Example:

	Dim depths as Integer

	depths = NSL.GetSupportedDepths()

    Notes:

	The bit manipulation functions in this library or the
	NS Basic Shared Library "BitsNBytes" probably provide
	the best suited functions for evaluating the returned value
	from this function.

<a name="DepthSupported"><h4>DepthSupported</h4>

	boolean = NSBSystemLib.DepthSupported(depth)

    Description:

	Returns 1 if the specified depth is supported by the
	PalmOS device.  Otherwise, it returns 0.

    Parameter:	depth as Integer

    Returns:	boolean as Integer

    Example:

	Dim boolean as Integer
	Dim depth as Integer
	
	depth = 4
	boolean = NSL.DepthSupported(depth)

<a name="ColorSupported"><h4>ColorSupported</h4>

	boolean = NSBSystemLib.ColorSupported()

    Description:

	Returns 1 if the PalmOS device has color capabilities.
	Otherwise, it returns 0.

    Parameters:	None

    Returns:	boolean as Integer

    Example:

	Dim boolean as Integer

	boolean = NSL.ColorSupported()

<a name="SetDepth"><h4>SetDepth</h4>

	NSBSystemLib.SetDepth depth

    Description:

	Sets the screen mode to support the specified bitmap
	bit depth.

    Parameter:	depth as Integer

    Returns:	None

    Example:

	Dim depth as Integer
	
	depth = 4
	NSL.SetDepth depth

<a name="SetColor"><h4>SetColor</h4>

	NSBSystemLib.SetColor boolean

    Description:

	Sets the screen mode to support color bitmaps.

    Parameter:	boolean as Integer
		       1 = support color
		       0 = do not support color

    Returns:	None

    Example:

	Dim boolean as Integer
	
	boolean = 1
	NSL.SetColor boolean

<a name="SaveScreenMode"><h4>SaveScreenMode</h4>

	NSBSystemLib.SaveScreenMode()

    Description:

	Saves the current screen mode parameters.  These parameters
	can later be restored by calling "RestoreScreenMode".  It is
	suggested that the current screen mode parameters be saved before
	any changes are requested and that these saved parameters
	are restored when the program exits.

    Parameters:	None

    Returns:	None

    Example:

	NSL.SaveScreenMode()

<a name="RestoreScreenMode"><h4>RestoreScreenMode</h4>

	NSBSystemLib.RestoreScreenMode()

    Description:

	Restores saved screen mode parameters.  These parameters
	must have been saved by calling "SaveScreenMode".  It is
	suggested that the current screen mode parameters be saved before
	any changes are requested and that these saved parameters
	are restored when the program exits.

    Parameters:	None

    Returns:	None

    Example:

	NSL.RestoreScreenMode()

<a name="CurrentDepth"><h4>CurrentDepth</h4>

	depth = NSBSystemLib.CurrentDepth()

    Description:

	Returns the current bitmap depth.

    Parameters:	None

    Returns:	depth as Integer

    Example:

	Dim depth as Integer

	depth = NSL.CurrentDepth()

<a name="CurrentColor"><h4>CurrentColor</h4>

	boolean = NSBSystemLib.CurrentColor()

    Description:

	Returns 1 if the PalmOS Device's screen mode is currently
	set to support color.   Otherwise, it returns 0.

    Parameters:	None

    Returns:	boolean as Integer

    Example:

	Dim boolean as Integer

	boolean = NSL.CurrentColor()

<a name="SetToDefaults"><h4>SetToDefaults</h4>

	NSBSystemLib.SetToDefaults()

    Description:

	Sets all screen mode parameters to their default values.

    Parameters:	None

    Returns:	None

    Example:

	NSL.SetToDefaults()

<a name="DefaultDepth"><h4>DefaultDepth</h4>

	depth = NSBSystemLib.DefaultDepth()

    Description:

	Returns the default bitmap depth.

    Parameters:	None

    Returns:	depth as Integer

    Example:

	Dim depth as Integer

	depth = NSL.DefaultDepth()

<a name="DefaultColor"><h4>DefaultColor</h4>

	boolean = NSBSystemLib.DefaultColor()

    Description:

	Returns 1 if the PalmOS Device's screen mode default is
	set to support color.   Otherwise, it returns 0.

    Parameters:	None

    Returns:	boolean as Integer

    Example:

	Dim boolean as Integer

	boolean = NSL.DefaultColor()

<a name="GetTableEntryIndex"><h4>GetTableEntryIndex</h4>

	index = NSBSystemLib.GetTableEntryIndex(which)

    Description:

	This function calls the PalmOS UIColorGetTableEntryIndex
	function.  It returns the index value for a UI color for the
	current system palette.

    Parameter:	which as Integer
		       UIObjectFrame = 0,
		       UIObjectFill = 1
		       UIObjectForeground = 2
		       UIObjectSelectedFill = 3
		       UIObjectSelectedForeground = 4
		       
		       UIMenuFrame = 5
		       UIMenuFill = 6
		       UIMenuForeground = 7
		       UIMenuSelectedFill = 8
		       UIMenuSelectedForeground = 9
		       
		       UIFieldBackground = 10
		       UIFieldText = 11
		       UIFieldTextLines = 12
		       UIFieldCaret = 13
		       UIFieldTextHighlightBackground = 14
		       UIFieldTextHighlightForeground = 15
		       UIFieldFepRawText = 16
		       UIFieldFepRawBackground = 17
		       UIFieldFepConvertedText = 18
		       UIFieldFepConvertedBackground = 19
		       UIFieldFepUnderline = 20
		       
		       UIFormFrame = 21
		       UIFormFill = 22
		       
		       UIDialogFrame = 23
		       UIDialogFill = 24
		       
		       UIAlertFrame = 25
		       UIAlertFill = 26
		       
		       UIOK = 27
		       UICaution = 28
		       UIWarning = 29

    Returns:	index as Integer
		       -1 = PalmOS version is less than 3.5

    Example:

	Dim index as Integer
	Dim which as Integer
	
	which = 11   'UIFieldText
	index = NSL.GetTableEntryIndex(which)

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="GetTableEntryRGB"><h4>GetTableEntryRGB</h4>

	index = NSBSystemLib.GetTableEntryRGB(which)

    Description:

	This function calls the PalmOS UIColorGetTableEntryRGB function.
	It retrieves the RGB values for the UI Color.  RGB Values are
	returned in a structure called "RGBColorType".  It contains the
	following fields:
		index, red, green, blue.
	This function retrieves all these values, but only returns
	the index.  To get the red, green, and blue values, call this
	function first and then call GetRGBRed, GetRGBGreen, and
	GetRGBBlue.  See the example for more information.

    Parameter:	which as Integer
		       (see the GetTableEntryIndex function for
		        a list of valid "Which" values")

    Returns:	index as Integer
		       -1 = PalmOS version is less than 3.5

    Example:

	Dim index as Integer
	Dim which as Integer
	Dim red as Integer
	Dim green as Integer
	Dim blue as Integer
	
	which = 11   'UIFieldText
	index = NSL.GetTableEntryRGB(which)
	red = SL.GetRGBRed()
	green = SL.GetRGBGreen()
	blue = SL.GetRGBBlue()

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="GetRGBIndex"><h4>GetRGBIndex</h4>

	index = NSBSystemLib.GetRGBIndex()

    Description:

	RGB Values are returned in a structure called "RGBColorType".
	It contains the following fields:
		index, red, green, blue.
	
	This function returns the index value that was previously
	retrieved by either the GetTableEntryRGB or IndexToRGB functions.

    Parameters:	None

    Returns:	index as Integer

    Example:

	Dim index as Integer

	index = NSL.GetRGBIndex()

<a name="GetRGBRed"><h4>GetRGBRed</h4>

	red = NSBSystemLib.GetRGBRed()

    Description:

	RGB Values are returned in a structure called "RGBColorType".
	It contains the following fields:
		index, red, green, blue.
	
	This function returns the red value that was previously
	retrieved by either the GetTableEntryRGB or IndexToRGB functions.

    Parameters:	None

    Returns:	red as Integer

    Example:

	See the example provided with either the GetTableEntryRGB or
	IndexToRGB functions.

<a name="GetRGBGreen"><h4>GetRGBGreen</h4>

	green = NSBSystemLib.GetRGBGreen()

    Description:

	RGB Values are returned in a structure called "RGBColorType".
	It contains the following fields:
		index, red, green, blue.
	
	This function returns the green value that was previously
	retrieved by either the GetTableEntryRGB or IndexToRGB functions.

    Parameters:	None

    Returns:	green as Integer

    Example:

	See the example provided with either the GetTableEntryRGB or
	IndexToRGB functions.

<a name="GetRGBBlue"><h4>GetRGBBlue</h4>

	blue = NSBSystemLib.GetRGBBlue()

    Description:

	RGB Values are returned in a structure called "RGBColorType".
	It contains the following fields:
		index, red, green, blue.
	
	This function returns the blue value that was previously
	retrieved by either the GetTableEntryRGB or IndexToRGB functions.

    Parameters:	None

    Returns:	blue as Integer

    Example:

	See the example provided with either the GetTableEntryRGB or
	IndexToRGB functions.

<a name="SetTableEntryIndex"><h4>SetTableEntryIndex</h4>

	NSBSystemLib.SetTableEntryIndex which, index

    Description:

	This subroutine calls the PalmOS IndexToRGB function and then
	it calls UIColorSetTableEntry.	It changes a value in the UI
	Color list.

    Parameters:	which as Integer
		       (see the GetTableEntryIndex function for
		        a list of valid "Which" values")
		index as Integer

    Returns:	None

    Example:

	Dim which as Integer
	Dim index as Integer

	NSL.SetTableEntryIndex which, index

    Notes:

	Some changes aren't reflected until the object or form is
	redrawn with the "Redraw" statement.  Even then, some changes
	like the form background (UIFormFill - 22) aren't reflected
	until until you change forms with a "NextScreen" statement.
	You might want to set some table entries in either the
	programs "Startup" code or just before you use the "NextScreen"
	statement.
	
	This function requires PalmOS version 3.5 or greater.

<a name="SetTableEntryRGB"><h4>SetTableEntryRGB</h4>

	NSBSystemLib.SetTableEntryRGB which, red, green, blue

    Description:

	This subroutine calls the PalmOS UIColorSetTableEntry function.
	It changes a value in the UI Color list.

    Parameters:	which as Integer
		       (see the GetTableEntryIndex function for
		        a list of valid "Which" values")
		red as Integer
		green as Integer
		blue as Integer
		       Red, Green, Blue valid values are 0 to 255

    Returns:	None

    Example:

	Dim which as Integer
	Dim red as Integer
	Dim green as Integer
	Dim blue as Integer

	NSL.SetTableEntryRGB which, red, green, blue

    Notes:

	Some changes aren't reflected until the object or form is
	redrawn with the "Redraw" statement.  Even then, some changes
	like the form background (UIFormFill - 22) aren't reflected
	until until you change forms with a "NextScreen" statement.
	You might want to set some table entries in either the
	programs "Startup" code or just before you use the "NextScreen"
	statement.
	
	This function requires PalmOS version 3.5 or greater.

<a name="BrightnessAdjust"><h4>BrightnessAdjust</h4>

	NSBSystemLib.BrightnessAdjust()

    Description:

	This subroutine calls the PalmOS UIBrightnessAdjust function.
	It displays the "Brightness Adjust" dialog.

    Parameters:	None

    Returns:	None

    Example:

	NSL.BrightnessAdjust()

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="ContrastAdjust"><h4>ContrastAdjust</h4>

	NSBSystemLib.ContrastAdjust()

    Description:

	This subroutine calls the PalmOS UIContrastAdjust function.
	It displays the "Contrast Adjust" dialog.

    Parameters:	None

    Returns:	None

    Example:

	NSL.ContrastAdjust()

    Notes:

	The PalmOS documentation states that this function only works
	on the "Palm V Connected Organizer".
	
	This function requires PalmOS version 3.5 or greater.

<a name="PickColorIndex"><h4>PickColorIndex</h4>

	changed = NSBSystemLib.PickColorIndex(index, title)

    Description:

	This function calls the PalmOS UIPickColor function.  It
	displays a Palette dialog to allow a user to select a
	color.  The selected index and RGB values can be retrieved
	by calling the GetRGBIndex, GetRGBRed, GetRGBGreen and
	GetRGBBlue functions.

    Parameters:	index as Integer
		       Suggested index
		title as String
		       Title to display on dialog

    Returns:	changed as Integer
		       -1 = PalmOS version is less than v3.5
		        0 = User cancelled or chose suggested index
		        1 = User chose a new index

    Example:

	Dim changed as Integer
	Dim index as Integer
	Dim title as String

	changed = NSL.PickColorIndex(index, title)

    Notes:

	This function requires PalmOS version of 3.5 or greater.

<a name="PickColorRGB"><h4>PickColorRGB</h4>

	changed = NSBSystemLib.PickColorRGB(red, green, blue, title)

    Description:

	This function calls the PalmOS UIPickColor function.  It
	displays an RGB dialog to allow a user to select a
	color.  The selected index and RGB values can be retrieved
	by calling the GetRGBIndex, GetRGBRed, GetRGBGreen and
	GetRGBBlue functions.

    Parameters:	red as Integer
		green as Integer
		blue as Integer
		       Suggested Red, Green, Blue values (0 to 255)
		title as String
		       Title to display on dialog

    Returns:	changed as Integer
		       -1 = PalmOS version is less than 3.5
		        0 = User cancelled or chose suggested colors
		        1 = User chose a new index

    Example:

	Dim changed as Integer
	Dim red as Integer
	Dim green as Integer
	Dim blue as Integer
	Dim title as String

	changed = NSL.PickColorRGB(red, green, blue, title)

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="IndexToRGB"><h4>IndexToRGB</h4>

	NSBSystemLib.IndexToRGB index

    Description:

	This subroutine calls the PalmOS WinIndexToRGB function.  It
	converts an index in the currently active color table to an
	RGB value.  RGB Values are returned in a structure called
	"RGBColorType".  It contains the following fields:
		index, red, green, blue.
	To get the actual index, red, green, and blue values, call this
	function first and then call GetRGBIndex, GetRGBRed, GetRGBGreen,
	and GetRGBBlue.  See the example for more information.

    Parameter:	index as Integer

    Returns:	None

    Example:

	Dim index as Integer

	NSL.IndexToRGB index

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="RGBToIndex"><h4>RGBToIndex</h4>

	index = NSBSystemLib.RGBToIndex(red, green, blue)

    Description:

	This function calls the PalmOS WinRGBToIndex function.  It
	converts RGB values to the index of the closest color in the
	currently active color lookup table (CLUT).

    Parameters:	red as Integer
		green as Integer
		blue as Integer
		       Red, Green, Blue valid values are 0 to 255

    Returns:	index as Integer
		       -1 = PalmOS version is less than 3.5

    Example:

	Dim index as Integer
	Dim red as Integer
	Dim green as Integer
	Dim blue as Integer

	index = NSL.RGBToIndex(red, green, blue)

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="SetForeColor"><h4>SetForeColor</h4>

	oldIndex = NSBSystemLib.SetForeColor(newIndex)

    Description:

	This function calls the PalmOS WinSetForeColor function.  It
	sets the foreground color to use in subsequent draw operations.

    Parameter:	newIndex as Integer

    Returns:	oldIndex as Integer
		       Previous foreground index
		       -1 = PalmOS version is less than 3.5

    Example:

	Dim oldIndex as Integer
	Dim newIndex as Integer

	oldIndex = NSL.SetForeColor(newIndex)

    Notes:

	Colors set with this function appear to be reset to default
	values when switching between forms or when a form is redrawn.
	It is probably best to call this function in the form's
	"After" code section.
	
	This function requires PalmOS version 3.5 or greater.

<a name="SetBackColor"><h4>SetBackColor</h4>

	oldIndex = NSBSystemLib.SetBackColor(newIndex)

    Description:

	This function calls the PalmOS WinSetBackColor function.  It
	sets the background color to use in subsequent draw operations.

    Parameter:	newIndex as Integer

    Returns:	oldIndex as Integer
		       Previous background index
		       -1 = PalmOS version is less than 3.5

    Example:

	Dim oldIndex as Integer
	Dim newIndex as Integer

	oldIndex = NSL.SetBackColor(newIndex)

    Notes:

	Colors set with this function appear to be reset to default
	values when switching between forms or when a form is redrawn.
	It is probably best to call this function in the form's
	"After" code section.
	
	This function requires PalmOS version 3.5 or greater.

<a name="SetTextColor"><h4>SetTextColor</h4>

	oldIndex = NSBSystemLib.SetTextColor(newIndex)

    Description:

	This function calls the PalmOS WinSetTextColor function.  It
	sets the color to use for drawing characters in subsequent draw
	operations.

    Parameter:	newIndex as Integer

    Returns:	oldIndex as Integer
		       Previous text color index
		       -1 = PalmOS version is less than 3.5

    Example:

	Dim oldIndex as Integer
	Dim newIndex as Integer

	oldIndex = NSL.SetTextColor(newIndex)

    Notes:

	Colors set with this function appear to be reset to default
	values when switching between forms or when a form is redrawn.
	It is probably best to call this function in the form's
	"After" code section.
	
	This function requires PalmOS version 3.5 or greater.

<a name="DrawLine"><h4>DrawLine</h4>

	NSBSystemLib.DrawLine x1, y1, x2, y2

    Description:

	This soubroutine calls the PalmOS WinDrawLine function.  It
	draws a line in the draw window using the current foreground
	color.

    Parameters:	x1 as Integer
		y1 as Integer
		x2 as Integer
		y2 as Integer

    Returns:	None

    Example:

	Dim x1 as Integer
	Dim y1 as Integer
	Dim x2 as Integer
	Dim y2 as Integer

	NSL.DrawLine x1, y1, x2, y2

    Notes:

	This function was provided for completeness only.  The
	built-in DrawLine NSBasic statement produces the same result.

<a name="DrawGrayLine"><h4>DrawGrayLine</h4>

	NSBSystemLib.DrawGrayLine x1, y1, x2, y2

    Description:

	This subroutine calls the PalmOS WinDrawGrayLine function.  It
	does not draw in a gray color, but rather draws with
	alternating foreground and background colors.

    Parameters:	x1 as Integer
		y1 as Integer
		x2 as Integer
		y2 as Integer

    Returns:	None

    Example:

	Dim x1 as Integer
	Dim y1 as Integer
	Dim x2 as Integer
	Dim y2 as Integer

	NSL.DrawGrayLine x1, y1, x2, y2

<a name="EraseLine"><h4>EraseLine</h4>

	NSBSystemLib.EraseLine x1, y1, x2, y2

    Description:

	This subroutine calls the PalmOS WinEraseLine function.  It
	draws a line in the draw window using the current background
	color.

    Parameters:	x1 as Integer
		y1 as Integer
		x2 as Integer
		y2 as Integer

    Returns:	None

    Example:

	Dim x1 as Integer
	Dim y1 as Integer
	Dim x2 as Integer
	Dim y2 as Integer

	NSL.EraseLine x1, y1, x2, y2

<a name="InvertLine"><h4>InvertLine</h4>

	NSBSystemLib.InvertLine x1, y1, x2, y2

    Description:

	This subroutine calls the PalmOS WinInvertLine function.  It
	draws an inverted line in the draw window.

    Parameters:	x1 as Integer
		y1 as Integer
		x2 as Integer
		y2 as Integer

    Returns:	None

    Example:

	Dim x1 as Integer
	Dim y1 as Integer
	Dim x2 as Integer
	Dim y2 as Integer

	NSL.InvertLine x1, y1, x2, y2

<a name="DrawPixel"><h4>DrawPixel</h4>

	NSBSystemLib.DrawPixel x, y

    Description:

	This subroutine calls the PalmOS WinDrawPixel function.  It
	draws a pixel in the draw window using the current foreground
	color.

    Parameters:	x as Integer
		y as Integer

    Returns:	None

    Example:

	Dim x as Integer
	Dim y as Integer

	NSL.DrawPixel x, y

<a name="ErasePixel"><h4>ErasePixel</h4>

	NSBSystemLib.ErasePixel x, y

    Description:

	This subroutine calls the PalmOS WinErasePixel function.  It
	draws a pixel in the draw window using the current background
	color.

    Parameters:	x as Integer
		y as Integer

    Returns:	None

    Example:

	Dim x as Integer
	Dim y as Integer

	NSL.ErasePixel x, y

<a name="InvertPixel"><h4>InvertPixel</h4>

	NSBSystemLib.InvertPixel x, y

    Description:

	This subroutine calls the PalmOS WinInvertPixel function.  It
	draws an inverted pixel in the draw window.

    Parameters:	x as Integer
		y as Integer

    Returns:	None

    Example:

	Dim x as Integer
	Dim y as Integer

	NSL.InvertPixel x, y

<a name="GetPixel"><h4>GetPixel</h4>

	index = NSBSystemLib.GetPixel(x, y)

    Description:

	This function calls the PalmOS WinGetPixel function.  It
	returns the color of the specified a pixel in the draw window.

    Parameters:	x as Integer
		y as Integer

    Returns:	index as Integer

    Example:

	Dim index as Integer
	Dim x as Integer
	Dim y as Integer

	index = NSL.GetPixel(x, y)

<a name="ScreenLock"><h4>ScreenLock</h4>

	success = NSBSystemLib.ScreenLock(mode)

    Description:

	This function calls the PalmOS WinScreenLock function.  It
	"locks" the current screen by switching the UI concept of the
	screen base address to an area that is not reflected on the
	display.  This routine can be used to "freeze" the display
	while doing lengthy drawing operations to avoid a flickering
	effect.  Call ScreenUnlock to unlock the display and cause
	it to be updated with any changes.  The screen must be unlocked
	as many times as it is locked to actually update the display.

    Parameter:	mode as Integer
		       winLockCopy = 0 - copy old screen to new
		       winLockErase = 1 - erase new screen to white
		       winLockDontCare = 2 - don't do anything

    Returns:	success as Integer
		       -1 = PalmOS version is less than 3.5
		        1 = success
		        0 = failure

    Example:

	Dim success as Integer
	Dim mode as Integer

	success = NSL.ScreenLock(mode)

    Notes:

	This function requires PalmOS version 3.5 or greater.

<a name="ScreenUnlock"><h4>ScreenUnlock</h4>

	NSBSystemLib.ScreenUnlock()

    Description:

	This subroutine calls the PalmOS WinScreenUnlock function.  Call
	ScreenUnlock to unlock the display and cause it to be updated
	with any changes.  The screen, which was locked by calling
	ScreenLock, must be unlocked as many times as it is locked to
	actually update the display.

    Parameters:	None

    Returns:	None

    Example:

	NSL.ScreenUnlock()

    Notes:

	This function requires PalmOS version 3.5 or greater.



</pre>
