|
|
Tech Note XX: Using the NSBSystemLib Shared Library Mon dd, yyyy
Copyright 2001 NS BASIC Corporation |
(Special thanks to Ron Glowka)
Version Information:
Version version = Version()
CompileInfo compileDateTime = CompileInfo()
SystemVersion version = SystemVersion()
Access To Shared Library Global Variables:
GlobalVersionMajor gblMajor = GlobalVersionMajor()
GlobalVersionMinor gblMinor = GlobalVersionMinor()
GlobalX x = GlobalX()
GlobalY y = GlobalY()
GlobalStartX startX = GlobalStartX()
GlobalStartY startY = GlobalStartY()
GlobalEndX endX = GlobalEndX()
GlobalEndY endY = GlobalEndY()
GlobalStartPos startPos = GlobalStartPos()
GlobalEndPos endPos = GlobalEndPos()
GlobalWidth width = GlobalWidth()
GlobalHeight height = GlobalHeight()
GlobalHour gblHour = GlobalHour()
GlobalMinute gblMinute = GlobalMinute()
Bit and String Manipulations:
String4ToInt intValue = String4ToInt(fourByteString)
IntToString4 fourByteString = IntToString4(intValue)
ANDInt result = ANDInt(int1, int2)
ORInt result = ORInt(int1, int2)
XORInt result = XORInt(int1, int2)
OnesComplement result = OnesComplement(intValue)
BitValue result = BitValue(intValue, bitNumber)
BitsValue result = BitsValue(intValue, bitNumber, numberOfBits)
SetBitValue result = SetBitValue(intValue, bitNumber, bitValue)
SetBitsValue result = SetBitsValue(intValue, bitsValue, bitNumber, numberOfBits)
IntToHex hexValue = IntToHex(intValue, trimLeading)
HexToInt intValue = HexToInt(hexValue)
IntToBin binValue = IntToBin(intValue, trimLeading)
BinToInt intValue = BinToInt(binValue)
DelimitedItem item = DelimitedItem(str, delimiter, nbr)
Localization Functions:
LocalizeNumber localNbrStr = LocalizeNumber(stdNbrStr)
DelocalizeNumber stdNbrStr = DelocalizeNumber(localNbrStr)
LocalizeDate localDateStr = LocalizeDate(stdDateStr, ToDateFormat, longDateFormat)
HotSync Data:
SyncUserName userName = SyncUserName()
SuccessfulSync syncDate = SuccessfulSync()
LastSync syncDate = LastSync()
Alarm Functions:
SetAlarmReset SetAlarmReset resetTime, resetLimit
SetAlarm status = SetAlarm(alarmPgm, alarmTime, alarmCmd, alarmMsg)
CancelAlarm status = CancelAlarm(alarmPgm)
GetAlarm alarmTime = GetAlarm(alarmPgm, alarmCmd, alarmMsg)
GetAlarmTime alarmTime = GetAlarmTime(alarmPgm)
GetAlarmResetTime resetTime = GetAlarmResetTime(alarmPgm)
GetAlarmResetLimit resetLimit = GetAlarmResetLimit(alarmPgm)
GetAlarmCommand alarmCmd = GetAlarmCommand(alarmPgm)
GetAlarmMessage alarmMsg = GetAlarmMessage(alarmPgm)
AlarmLog alarmTime = AlarmLog(alarmPgm, alarmCmd, alarmMsg)
AlarmLogAlarmTime alarmTime = AlarmLogAlarmTime(alarmPgm)
AlarmLogResetTime resetTime = AlarmLogResetTime(alarmPgm)
AlarmLogResetLimit resetLimit = AlarmLogResetLimit(alarmPgm)
AlarmLogResetCount resetCount = AlarmLogResetCount(alarmPgm)
AlarmLogCommand alarmCmd = AlarmLogCommand(alarmPgm)
AlarmLogMessage alarmMsg = AlarmLogMessage(alarmPgm)
ClearAlarmLog alarmPgm = ClearAlarmLog()
Database Functions:
FindDatabase dbLocalID = FindDatabase(cardNo, dbName)
DatabaseInfo dbName = DatabaseInfo(cardNo, dbLocalID)
DatabaseName dbName = DatabaseName()
DatabaseAttributes dbAttributes = DatabaseAttributes()
DatabaseVersion dbVersion = DatabaseVersion()
DatabaseCreationDate dbCreationDate = DatabaseCreationDate()
DatabaseModificationDate dbModificationDate = DatabaseModificationDate()
DatabaseBackupDate dbBackupDate = DatabaseBackupDate()
DatabaseModificationNumber dbModificationNumber = DatabaseModificationNumber()
DatabaseAppInfoID dbAppInfoID = DatabaseAppInfoID()
DatabaseSortInfoID dbSortInfoID = DatabaseSortInfoID()
DatabaseType dbType = DatabaseType()
DatabaseCreatorID dbCreatorID = DatabaseCreatorID()
DatabaseTotalSize dbTotalSize = DatabaseTotalSize(cardNo, dbLocalID)
DatabaseNumRecords dbNumRecords = DatabaseNumRecords()
DatabaseDataSize dbDataSize = DatabaseDataSize()
DeleteDatabase status = DeleteDatabase(cardNo, dbLocalID)
GetNextDatabaseByTypeCreator dbLocalID = GetNextDatabaseByTypeCreator(newSearch, dbType, dbCreatorID, onlyLatestVersion)
DatabaseCardNo dbCardNo = DatabaseCardNo()
NumDatabases nbr = NumDatabases(cardNo)
NumCards nbr = NumCards()
GetDatabase dbLocalID = GetDatabase(cardNo, index)
SetDatabaseName status = SetDatabaseName(cardNo, dbLocalID, dbName)
SetDatabaseAttributes status = SetDatabaseAttributes(cardNo, dbLocalID, dbAttributes)
SetDatabaseVersion status = SetDatabaseVersion(cardNo, dbLocalID, dbVersion)
SetDatabaseCreationDate status = SetDatabaseCreationDate(cardNo, dbLocalID, dbCreationDate)
SetDatabaseModificationDate status = SetDatabaseModificationDate(cardNo, dbLocalID, dbModificationDate)
SetDatabaseBackupDate status = SetDatabaseBackupDate(cardNo, dbLocalID, dbBackupDate)
SetDatabaseModificationNumber status = SetDatabaseModificationNumber(cardNo, dbLocalID, dbModificationNumber)
SetDatabaseAppInfoID status = SetDatabaseAppInfoID(cardNo, dbLocalID, dbAppInfoID)
SetDatabaseSortInfoID status = SetDatabaseSortInfoID(cardNo, dbLocalID, dbSortInfoID)
SetDatabaseType status = SetDatabaseType(cardNo, dbLocalID, dbType)
SetDatabaseCreatorID status = SetDatabaseCreatorID(cardNo, dbLocalID, dbCreatorID)
Event Functions:
GetEvent eventType = GetEvent(timeoutTicks, consumePenEvents, returnVirtualEvents)
SysHandleEvent SysHandleEvent()
FlushEvents FlushEvents()
KeyEventChr keyChr = KeyEventChr()
KeyEventKeyCode keyCode = KeyEventKeyCode()
KeyEventModifiers modifiers = KeyEventModifiers()
Field and Form Functions:
ControlHitControl ControlHitControl objID
FieldCopy FieldCopy objID
FieldCut FieldCut objID
FieldInsert FieldInsert objID, insString
FieldPaste FieldPaste objID
FieldUndo FieldUndo objID
FieldGetInsPtPosition pos = FieldGetInsPtPosition(objID)
FieldGetSelection startPos = FieldGetSelection(objID)
FieldAnyDirty dirty = FieldAnyDirty()
FieldDirty dirty = FieldDirty(objID)
FieldSetDirty FieldSetDirty objID, dirty
FieldSetAllDirty FieldSetAllDirty dirty
FieldSetSelection FieldSetSelection objID, startPos, endPos
FieldSetInsertionPoint FieldSetInsertionPoint objID, pos
FieldSetInsPtPosition FieldSetInsPtPosition objID, pos
FormGetNumberOfObjects nbr = FormGetNumberOfObjects()
FormGetObjectBounds x = FormGetObjectBounds(objID)
FormGetObjectPosition x = FormGetObjectPosition(objID)
FormGetObjectType type = FormGetObjectType(objID)
FormSetObjectPosition FormSetObjectPosition objID, x, y
Preference Functions:
GetAppPreferences data = GetAppPreferences(pgmName, prefId, saved)
SetAppPreferences status = SetAppPreferences(pgmName, prefId, data, saved)
GetSysPreference data = GetSysPreference(prefID)
SetSysPreference SetSysPreference prefID, data
Progress Manager Functions:
ProgressStartDialog ProgressStartDialog title
ProgressStopDialog ProgressStopDialog force
ProgressUpdateDialog ProgressUpdateDialog error, message
ProgressUserCancel canceled = ProgressUserCancel()
ProgressPercent percent = ProgressPercent(current, count)
ProgressPercentString strValue = ProgressPercentString(percent, resolution, completeChar, incompleteChar)
System Time Functions:
SelectOneTime newTimeSelected = SelectOneTime(defHour, defMinute, title)
IncrementSystemTime newSysTime = IncrementSystemTime(oldSysTime, hours, minutes, seconds)
SystemTime sysTime = SystemTime(strDate, strTime, seconds, ToDateFormat)
StringDateTime strDateTime = StringDateTime(sysTime, ToDateFormat, ToTimeFormat, AMPMFormat)
StringDate strDate = StringDate(sysTime, ToDateFormat)
StringTime strTime = StringTime(sysTime, ToTimeFormat, AMPMFormat)
Screen and Color Functions:
GetSupportedDepths depths = GetSupportedDepths()
DepthSupported boolean = DepthSupported(depth)
ColorSupported boolean = ColorSupported()
SetDepth SetDepth depth
SetColor SetColor boolean
SaveScreenMode SaveScreenMode()
RestoreScreenMode RestoreScreenMode()
CurrentDepth depth = CurrentDepth()
CurrentColor boolean = CurrentColor()
SetToDefaults SetToDefaults()
DefaultDepth depth = DefaultDepth()
DefaultColor boolean = DefaultColor()
GetTableEntryIndex index = GetTableEntryIndex(which)
GetTableEntryRGB index = GetTableEntryRGB(which)
GetRGBIndex index = GetRGBIndex()
GetRGBRed red = GetRGBRed()
GetRGBGreen green = GetRGBGreen()
GetRGBBlue blue = GetRGBBlue()
SetTableEntryIndex SetTableEntryIndex which, index
SetTableEntryRGB SetTableEntryRGB which, red, green, blue
BrightnessAdjust BrightnessAdjust()
ContrastAdjust ContrastAdjust()
PickColorIndex changed = PickColorIndex(index, title)
PickColorRGB changed = PickColorRGB(red, green, blue, title)
IndexToRGB IndexToRGB index
RGBToIndex index = RGBToIndex(red, green, blue)
SetForeColor oldIndex = SetForeColor(newIndex)
SetBackColor oldIndex = SetBackColor(newIndex)
SetTextColor oldIndex = SetTextColor(newIndex)
DrawLine DrawLine x1, y1, x2, y2
DrawGrayLine DrawGrayLine x1, y1, x2, y2
EraseLine EraseLine x1, y1, x2, y2
InvertLine InvertLine x1, y1, x2, y2
DrawPixel DrawPixel x, y
ErasePixel ErasePixel x, y
InvertPixel InvertPixel x, y
GetPixel index = GetPixel(x, y)
ScreenLock success = ScreenLock(mode)
ScreenUnlock ScreenUnlock()
******************************** NSBSystemLib Function Reference: ********************************Version Information:
Version
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()CompileInfo
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()SystemVersion
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()Access To Shared Library Global Variables:
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 IfGlobalVersionMajor
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()GlobalVersionMinor
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()GlobalX
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()GlobalY
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()GlobalStartX
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()GlobalStartY
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()GlobalEndX
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()GlobalEndY
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()GlobalStartPos
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()GlobalEndPos
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()GlobalWidth
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()GlobalHeight
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()GlobalHour
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()GlobalMinute
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()Bit and String Manipulations:
String4ToInt
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()IntToString4
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()ANDInt
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)ORInt
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)XORInt
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)OnesComplement
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)BitValue
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)BitsValue
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)SetBitValue
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)SetBitsValue
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)IntToHex
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)HexToInt
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)IntToBin
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)BinToInt
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)DelimitedItem
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.Localization Functions:
LocalizeNumber
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)DelocalizeNumber
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)LocalizeDate
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)HotSync Data:
SyncUserName
userName = NSBSystemLib.SyncUserName() Description: Returns the HotSync user name. Parameters: None Returns: userName as String Example: Dim userName as String userName = NSL.SyncUserName()SuccessfulSync
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()LastSync
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()Alarm Functions:
SetAlarmReset
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.SetAlarm
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:[, ][; ] 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() CancelAlarm
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)GetAlarm
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()GetAlarmTime
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()GetAlarmResetTime
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)GetAlarmResetLimit
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)GetAlarmCommand
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)GetAlarmMessage
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)AlarmLog
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()AlarmLogAlarmTime
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()AlarmLogResetTime
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)AlarmLogResetLimit
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)AlarmLogResetCount
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)AlarmLogCommand
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)AlarmLogMessage
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)ClearAlarmLog
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()Database Functions:
FindDatabase
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)DatabaseInfo
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()DatabaseName
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.DatabaseAttributes
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.DatabaseVersion
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.DatabaseCreationDate
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()DatabaseModificationDate
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()DatabaseBackupDate
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()DatabaseModificationNumber
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.DatabaseAppInfoID
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.DatabaseSortInfoID
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.DatabaseType
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()DatabaseCreatorID
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()DatabaseTotalSize
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()DatabaseNumRecords
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.DatabaseDataSize
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.DeleteDatabase
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()GetNextDatabaseByTypeCreator
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()DatabaseCardNo
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.NumDatabases
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()NumCards
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()GetDatabase
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()SetDatabaseName
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)SetDatabaseAttributes
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)SetDatabaseVersion
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)SetDatabaseCreationDate
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)SetDatabaseModificationDate
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)SetDatabaseBackupDate
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)SetDatabaseModificationNumber
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)SetDatabaseAppInfoID
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)SetDatabaseSortInfoID
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)SetDatabaseType
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);SetDatabaseCreatorID
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);Event Functions:
GetEvent
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.SysHandleEvent
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()FlushEvents
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()KeyEventChr
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()KeyEventKeyCode
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()KeyEventModifiers
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()Field and Form Functions:
ControlHitControl
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 objIDFieldCopy
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 objIDFieldCut
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 objIDFieldInsert
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, insStringFieldPaste
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 objIDFieldUndo
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 objIDFieldGetInsPtPosition
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()FieldGetSelection
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()FieldAnyDirty
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()FieldDirty
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)FieldSetDirty
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, dirtyFieldSetAllDirty
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 dirtyFieldSetSelection
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, endPosFieldSetInsertionPoint
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()FieldSetInsPtPosition
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()FormGetNumberOfObjects
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()FormGetObjectBounds
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.FormGetObjectPosition
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.FormGetObjectType
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)FormSetObjectPosition
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, yPreference Functions:
GetAppPreferences
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.SetAppPreferences
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.GetSysPreference
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)SetSysPreference
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, dataProgress Manager Functions:
ProgressStartDialog
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()ProgressStopDialog
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()ProgressUpdateDialog
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().ProgressUserCancel
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().ProgressPercent
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().ProgressPercentString
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().System Time Functions:
SelectOneTime
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 IfIncrementSystemTime
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)SystemTime
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()StringDateTime
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()StringDate
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()StringTime
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()Screen and Color Functions:
GetSupportedDepths
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.DepthSupported
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)ColorSupported
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()SetDepth
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 depthSetColor
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 booleanSaveScreenMode
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()RestoreScreenMode
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()CurrentDepth
depth = NSBSystemLib.CurrentDepth() Description: Returns the current bitmap depth. Parameters: None Returns: depth as Integer Example: Dim depth as Integer depth = NSL.CurrentDepth()CurrentColor
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()SetToDefaults
NSBSystemLib.SetToDefaults() Description: Sets all screen mode parameters to their default values. Parameters: None Returns: None Example: NSL.SetToDefaults()DefaultDepth
depth = NSBSystemLib.DefaultDepth() Description: Returns the default bitmap depth. Parameters: None Returns: depth as Integer Example: Dim depth as Integer depth = NSL.DefaultDepth()DefaultColor
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()GetTableEntryIndex
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.GetTableEntryRGB
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.GetRGBIndex
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()GetRGBRed
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.GetRGBGreen
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.GetRGBBlue
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.SetTableEntryIndex
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.SetTableEntryRGB
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.BrightnessAdjust
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.ContrastAdjust
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.PickColorIndex
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.PickColorRGB
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.IndexToRGB
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.RGBToIndex
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.SetForeColor
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.SetBackColor
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.SetTextColor
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.DrawLine
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.DrawGrayLine
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, y2EraseLine
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, y2InvertLine
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, y2DrawPixel
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, yErasePixel
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, yInvertPixel
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, yGetPixel
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)ScreenLock
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.ScreenUnlock
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.