PowerScript Reference

Appeon PowerBuilder® 2021

FOR WINDOWS

DOCUMENT ID: DC37781-01-1900-01

LAST REVISED: October 26, 2021

Copyright © Appeon. All rights reserved.

This publication pertains to Appeon software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement.

Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Appeon Inc.

Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Inc.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP and SAP affiliate company.

Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other countries.

Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.

All other company and product names mentioned may be trademarks of the respective companies with which they are associated.

Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.

Appeon Inc., 1/F, Shell Industrial Building, 12 Lee Chung Street, Chai Wan District, Hong Kong.

Table of Contents

PowerScript Topics
Language Basics
Comments
Identifier names
Labels
Special ASCII characters
NULL values
Reserved words
Pronouns
Statement continuation
Statement separation
White space
Conditional compilation
Datatypes
Standard datatypes
The Any datatype
System object datatypes
Enumerated datatypes
Declarations
Declaring variables
Declaring constants
Declaring arrays
Declaring external functions
Declaring DBMS stored procedures as remote procedure calls
Operators and Expressions
Operators in PowerBuilder
Operator precedence in PowerBuilder expressions
Datatype of PowerBuilder expressions
Structures and Objects
About structures
About objects
Assignment for objects and structures
Calling Functions and Events
About functions and events
Finding and executing functions and events
Triggering versus posting functions and events
Static versus dynamic calls
Overloading, overriding, and extending functions and events
Passing arguments to functions and events
Using return values
Syntax for calling PowerBuilder functions and events
Calling functions and events in an object's ancestor
Statements, Events, and Functions
PowerScript Statements
Assignment
CALL
CHOOSE CASE
CONTINUE
CREATE
DESTROY
DO...LOOP
EXIT
FOR...NEXT
GOTO
HALT
IF...THEN
RETURN
THROW
THROWS
TRY...CATCH...FINALLY...END TRY
SQL Statements
Using SQL in scripts
Using dynamic SQL
PowerScript Events
About events
Activate
AddressChange
BeginDownload
BeginDrag
BeginLabelEdit
BeginLogScan
BeginRightDrag
BeginSync
BeginUpload
CategoryCollapsed
CategoryExpanded
CategorySelectionChanged
CategorySelectionChanging
CertificateError
Clicked
Close
CloseQuery
CloseUp
ColumnClick
ConnectMobiLink
Constructor
DataChange
DateChanged
DateSelected
DBError
DBNotification
Deactivate
DeleteAllItems
DeleteItem
Destructor
DisconnectMobiLink
DisplayMessage
DoubleClicked
DownloadingStart
DownloadingStateChanged
DragDrop
DragEnter
DragLeave
DragWithin
DropDown
EndDownload
EndLabelEdit
EndLogScan
EndSync
EndUpload
Error
ErrorMessage
EvaluateJavascriptFinished
ExternalException
FileExists
FileMessage
Finished
Gesture
GetFocus
Help
Hide
HotLinkAlarm
Idle
InputFieldSelected
InsertItem
ItemActivate
ItemChanged
ItemChanging
ItemCollapsed
ItemCollapsing
ItemExpanded
ItemExpanding
ItemPopulate
ItemUnselected
Key
LineDown
LineLeft
LineRight
LineUp
LoseFocus
Modified
MouseDown
MouseMove
MouseUp
Moved
NavigationError
NavigationProgressIndex
NavigationStart
NavigationStateChanged
Notify
Open
Other
PageDown
PageLeft
PageRight
PageUp
PictureSelected
PipeEnd
PipeMeter
PipeStart
PrintFooter (obsolete)
PrintHeader (obsolete)
PdfPrintFinished
ProcessingFile
ProgressIndex
PropertyChanged
PropertyRequestEdit
RButtonDown
RButtonUp
RecognitionResult
RemoteExec
RemoteHotLinkStart
RemoteHotLinkStop
RemoteRequest
RemoteSend
Rename
Resize
ResourceRedirect
RightClicked
RightDoubleClicked
Save
SaveObject
Selected
SelectionChanged
SelectionChanging
Show
SizeCompleted
Sort
SQLPreview
Start
Stop
Stroke
SyncPreview
SystemError
SystemKey
Timer
TitleTextChanged
ToolbarMoved
UploadAck
UserString
ValueChanged
ViewChange
WaitForUploadAck
WarningMessage
PowerScript Functions
Abs
ACos
AccessToken
Activate
AddCategory
AddColumn
AddData
AddItem
AddItemArray
AddItemBlob
AddItemBoolean
AddItemDate
AddItemDateTime
AddItemNull
AddItemNumber
AddItemObject
AddItemString
AddItemTime
AddLargePicture
AddMasterSeparatorItem
AddPicture
AddSeparatorItem
AddSeries
AddSmallPicture
AddStatePicture
AddToLibraryList
AppendParam
ApplyTheme
Arrange
ArrangeSheets
Asc
AscA
ASin
AsymmetricDecrypt
AsymmetricEncrypt
AsymmetricGenerateKey
AsymmetricSign
AsymmetricVerifySign
ATan
Base32Decode
Base32Encode
Base64Decode
Base64Encode
Base64UrlDecode
Base64UrlEncode
Beep
BeginSession
BeginTransaction (obsolete)
Blob
BlobEdit
BlobMid
BuildModel
Byte
Cancel
CancelDownload
CancelSync
CanUndo
CategoryCount
CategoryName
Ceiling
ChangeDirectory
ChangeMenu
Char
CharA
Check
ChooseColor
ClassList
ClassName
Clear
ClearAll
ClearBoldDates
ClearHeaders
ClearParams
ClearRecentItems
ClearRequestHeaders
Clipboard
Close
CloseChannel
CloseTab
CloseUserObject
CloseWithReturn
CollapseItem
CommandParm
CommitDocking
CommitTransaction (obsolete)
Compress
ConnectToNewObject
ConnectToNewRemoteObject
ConnectToObject
ConnectToRemoteObject
ConnectToServer (obsolete)
ContainsKey
ContainsPath
Copy
CopyRTF
Cos
Cpu
CreateDirectory
CreateInstance
CreateJsonArray
CreateJsonObject
CreatePage
Cut
DataCount
DataSource
Date
DateTime
Day
DayName
DayNumber
DaysAfter
DBHandle
DebugBreak
Dec
DeleteCategory
DeleteCheckBox
DeleteColumn
DeleteColumns
DeleteComboBox
DeleteData
DeleteGroup
DeleteItem
DeleteItems
DeleteLargeButton
DeleteLargePicture
DeleteLargePictures
DeleteMasterItem
DeletePanel
DeletePicture
DeletePictures
DeleteRecentItem
DeleteSeries
DeleteSmallButton
DeleteSmallPicture
DeleteSmallPictures
DeleteStatePicture
DeleteStatePictures
DeleteTabButton
DestroyModel
DirectoryExists
DirList
DirSelect
Disable
DisableCommit
DisconnectObject
DisconnectServer
Double
DoVerb
Drag
DraggedObject (obsolete)
Draw
EditLabel
Enable
EnableCommit
EntryList
EvaluateJavascriptAsync
EvaluateJavascriptSync
ExecRemote
Exp
ExpandAll
ExpandItem
ExportJSON
ExportXML
ExportToJSONFile
ExportToXMLFile
Extract
Fact
FileClose
FileCopy
FileDelete
FileEncoding
FileExists
FileLength
FileLength64
FileMove
FileOpen
FileRead
FileReadEx
FileSeek
FileSeek64
FileWrite
FileWriteEx
Fill
FillA
FillW (obsolete)
Find
FindCategory
FindClassDefinition
FindFunctionDefinition
FindItem
FindMatchingFunction
FindNext
FindSeries
FindTypeDefinition
FromAnsi
FromUnicode
GarbageCollect
GarbageCollectGetTimeLimit
GarbageCollectSetTimeLimit
GetAccessToken
GetActiveCategory
GetActiveSheet
GetAlignment
GetApplication
GetApplicationButton
GetArgElement
GetAutomationNativePointer
GetBestHeight
GetBody
GetBoxPictureList
GetByte
GetByteArray
GetCategory
GetCategoryByIndex
GetCategoryCount
GetCategoryIndex
GetCertificateLabel (obsolete)
GetCheckBox
GetChildCount
GetChildItem
GetChildItemByIndex
GetChildItemCount
GetChildKey
GetChildrenList
GetColumn
GetComboBox
GetCommandDDE
GetCommandDDEOrigin
GetCommandString
GetCompanyName
GetContextKeywords
GetContextService
GetCredentialAttribute (obsolete)
GetCurrentDirectory
GetData
GetDataDDE
GetDataDDEOrigin
GetDataLabelling
GetDataPieExplode
GetDataStyle
GetDataTransparency
GetDataValue
GetDateLimits
GetDbmlsyncPath
GetDisplayRange
GetDotNetCoreVersion
GetDynamicDate
GetDynamicDateTime
GetDynamicDecimal
GetDynamicNumber
GetDynamicString
GetDynamicTime
GetEnvironment
GetExpiresIn
GetFileOpenName
GetFileSaveName
GetFilesCount
GetFilesList
GetFirstSheet
GetFixesVersion
GetFocus
GetFolder
GetGroup
GetGlobalProperty (obsolete)
GetHeader
GetHeaders
GetHostObject
GetHttpResponseHeaders
GetHttpResponseStatusCode
GetHttpResponseStatusText
GetInstalledRuntimes
GetItem
GetItemArray
GetItemArrayJSONString
GetItemAtPointer
GetItemBlob
GetItemBoolean
GetItemByTag
GetItemByPath
GetItemCount
GetItemDate
GetItemDateTime
GetItemNumber
GetItemObject
GetItemObjectJSONString
GetItemParent
GetItemString
GetItemTime
GetItemType
GetJsonBlob
GetJsonString
GetJWTToken
GetKey
GetLargeButton
GetLastReturn
GetLibraryList
GetMajorVersion
GetMasterItem
GetMasterItemCount
GetMenu
GetMenuByButtonHandle
GetMessage
GetMinorVersion
GetName
GetNativePointer
GetNextSheet
GetNumberType
GetOAuthToken
GetObjectRevisionFromRegistry
GetOrigin
GetPanel
GetParagraphSetting
GetParent
GetPathByItem
GetPin (obsolete)
GetRecentItem
GetRecentItemCount
GetRecentTitle
GetRecordSet
GetRefreshToken
GetRemote
GetRequestHeader
GetRequestHeaders
GetResponseBody
GetResponseHeader
GetResponseHeaders
GetResponseStatusCode
GetResponseStatusText
GetRootItem
GetSelectedDate
GetSelectedRange
GetSeriesLabelling
GetSeriesStyle
GetSeriesTransparency
GetSessionID
GetShortName
GetSmallButton
GetSource
GetSpacing
GetStatusCode
GetStatusText
GetStatus (obsolete)
GetSyncRegistryProperties
GetTabButton
GetTabButtonByIndex
GetTabButtonCount
GetText
GetTextColor
GetTextStyle
GetTheme
GetToday
GetTokenError
GetTokenType
GetToolbar
GetToolbarPos
GetTransactionName (obsolete)
GetURL
GetValue
GetValueBlob
GetValueBoolean
GetValueDate
GetValueDateTime
GetValueNumber
GetValueString
GetValueTime
GetValueToDataWindow
GetVersionName
GoBack
GoForward
Handle
HexDecode
HexEncode
Hide
HMAC
Hour
HyperLinkToURL
Idle
ImpersonateClient
ImportClipboard
ImportFile
ImportString
ImportJSON
ImportXML
ImportFromJSONFile
ImportFromXMLFile
IncomingCallList
Init (obsolete)
InputFieldChangeData
InputFieldCurrentName
InputFieldDeleteCurrent
InputFieldGetData
InputFieldInsert
InputFieldLocate
InsertCategory
InsertCategoryFirst
InsertCategoryLast
InsertCheckBox
InsertCheckBoxFirst
InsertCheckBoxLast
InsertClass
InsertColumn
InsertComboBox
InsertComboBoxFirst
InsertComboBoxLast
InsertData
InsertDocument
InsertFile
InsertGroup
InsertGroupFirst
InsertGroupLast
InsertItem
InsertItemFirst
InsertItemLast
InsertItemSort
InsertLargeButton
InsertLargeButtonFirst
InsertLargeButtonLast
InsertMasterItem
InsertMasterItemFirst
InsertMasterItemLast
InsertObject
InsertPanel
InsertPanelFirst
InsertPanelLast
InsertPicture
InsertRecentItem
InsertRecentItemFirst
InsertRecentItemLast
InsertSeries
InsertSmallButton
InsertSmallButtonFirst
InsertSmallButtonLast
InsertTabButton
InsertTabButtonFirst
InsertTabButtonLast
Int
Integer
InternetData
IntHigh
IntLow
InvokePBFunction
_Is_A (obsolete)
IsAlive
IsAllArabic
IsAllHebrew
IsAnyArabic
IsAnyHebrew
IsArabic
IsArabicAndNumbers
IsCallerInRole
IsDate
IsHebrew
IsHebrewAndNumbers
IsImpersonating
IsInTransaction (obsolete)
IsMinimized
IsNull
IsNumber
IsPBApp
IsPowerClientApp
IsPowerServerApp
IsPreview
IsSecurityEnabled
IsTime
IsTransactionAborted (obsolete)
IsValid
KeyCount
KeyDown
LastPos
Left
LeftA
LeftW (obsolete)
LeftTrim
LeftTrimW (obsolete)
Len
LenA
LenW (obsolete)
Length
LibraryCreate
LibraryDelete
LibraryDirectory
LibraryDirectoryEx
LibraryExport
LibraryImport
LineCount
LineLength
LineList
LinkTo
LoadDockingState
LoadFile
LoadString
LoadInk
LoadPicture
LoadWithDotNetCore
LoadWithDotNetFramework
Log
LogTen
Long
LongLong
Lookup (obsolete)
Lower
LowerBound
mailAddress
mailDeleteMessage
mailGetMessages
mailHandle
mailLogoff
mailLogon
mailReadMessage
mailRecipientDetails
mailResolveRecipient
mailSaveMessage
mailSend
Match
MatchW (obsolete)
Max
MD5
MemberDelete
MemberExists
MemberRename
MessageBox
Mid
MidA
MidW (obsolete)
Min
Minute
Mod
ModifyData
Month
Move
MoveTab
_Narrow (obsolete)
Navigate
NextActivity
Now
ObjectAtPointer
OffsetPos
Open
OpenChannel
OpenSheet
OpenSheetAsDocument
OpenSheetDocked
OpenSheetFromDockingState
OpenSheetInTabGroup
OpenSheetWithParm
OpenSheetWithParmAsDocument
OpenSheetWithParmDocked
OpenSheetWithParmFromDockingState
OpenSheetWithParmInTabGroup
OpenTab
OpenTabWithParm
OpenUserObject
OpenUserObjectWithParm
OpenWithParm
OutgoingCallList
PageCount
PageCreated
ParentWindow
Paste
PasteLink
PasteRTF
PasteSpecial
PauseDownload
PBAddCookie (Obsolete)
PBGetCookies (Obsolete)
PBGetMenuString
Pi
PixelsToUnits
Play
PointerX
PointerY
PopMenu
PopulateError
Pos
PosA
PosW (obsolete)
Position
Post
PostData
PostDataEnd
PostDataStart
PostEvent
PostURL
Preview
Print
PrintAsPDF
PrintBitmap
PrintCancel
PrintClose
PrintDataWindow
PrintDefineFont
PrintEx
PrintGetPrinter
PrintGetPrinters
PrintLine
PrintOpen
PrintOval
PrintPage
PrintRect
PrintRoundRect
PrintScreen
PrintSend (obsolete)
PrintSetFont
PrintSetPrinter
PrintSetSpacing
PrintSetup
PrintSetupPrinter
PrintText
PrintWidth
PrintX
PrintY
ProfileInt
ProfileString
Rand
Randomize
Read
ReadData
Real
RecognizeText
Refresh
RegisterEvent
RegistryDelete
RegistryGet
RegistryKeys
RegistrySet
RegistryValues
RelativeDate
RelativeTime
ReleaseAutomationNativePointer
ReleaseNativePointer
Remove
RemoveApplicationButton
RemoveDirectory
RequestResource
Repair
Replace
ReplaceA
ReplaceText
ReplaceW (obsolete)
Reset
ResetArgElements
ResetDataColors
ResetInk
ResetPicture
Resize
RespondRemote
Restart
ResumeDownload
ResumeTransaction (obsolete)
Retrieve
RetrieveOne
Reverse
RevertToSelf
RGB
Right
RightA
RightW (obsolete)
RightTrim
RightTrimW (obsolete)
RollbackOnly (obsolete)
RollbackTransaction (obsolete)
Round
RoutineList
Run
Save
SaveAs
SaveDockingState
SaveDocument
SaveInk
SaveToFile
Scroll
ScrollNextPage
ScrollNextRow
ScrollPriorPage
ScrollPriorRow
ScrollToRow
Second
SecondsAfter
Seek
SelectedColumn
SelectedIndex
SelectedItem
SelectedLength
SelectedLine
SelectedPage
SelectedStart
SelectedText
SelectionRange
SelectItem
SelectObject
SelectTab
SelectText
SelectTextAll
SelectTextLine
SelectTextWord
Send
SendDeleteRequest
SendGetRequest
SendPatchRequest
SendPostRequest
SendPutRequest
SendRequest
SeriesCount
SeriesName
SetAbort
SetAccessToken
SetActiveCategory
SetActiveCategoryByIndex
SetAlignment
SetApplicationButton
SetArgElement
SetAutomationLocale
SetAutomationPointer
SetAutomationTimeout
SetBody
SetBoldDate
SetBoxPictureList
SetByte
SetCategory
SetCheckBox
SetColumn
SetComboBox
SetComplete
SetData
SetDataDDE
SetDataLabelling
SetDataPieExplode
SetDataStyle
SetDataTransparency
SetDateLimits
SetDropHighlight
SetDynamicParm
SetFirstVisible
SetFocus
SetGroup
SetGlobalProperty (obsolete)
SetHeader
SetHeaders
SetHttpRequestHeader
SetItem
SetJWTToken
SetLargeButton
SetLevelPictures
SetLibraryList
SetMask
SetMasterItem
SetMenu
SetMessage
SetMicroHelp
SetMinimized
SetNewMobiLinkPassword
SetNull
SetOAuthToken
SetOverlayPicture
SetPanel
SetParagraphSetting
SetParm
SetPicture
SetPointer
SetPosition
SetProfileString
SetRange
SetRecentItem
SetRecentTitle
SetRecordSet
SetRedraw
SetRemote
SetRequestHeader
SetRequestHeaders
SetResultSet
SetSelectedDate
SetSelectedRange
SetSeriesLabelling
SetSeriesStyle
SetSeriesTransparency
SetSheetID
SetSmallButton
SetSpacing
SetState
SetSyncRegistryProperties
SetTabButton
SetTextColor
SetTextStyle
SetTimeout (obsolete)
SetToday
SetToolbar
SetToolbarPos
SetTop
SetTraceFileName
SetTransPool
SetValue
SetValueBlob
SetValueBoolean
SetValueByDataWindow
SetValueDate
SetValueDateTime
SetValueNumber
SetValueString
SetValueTime
SHA
SharedObjectDirectory
SharedObjectGet
SharedObjectRegister
SharedObjectUnregister
Show
ShowHeadFoot
ShowHelp
ShowPopupHelp
Sign
SignalError
Sin
Sleep
Sort
SortAll
Space
Sqrt
Start
StartHotLink
StartServerDDE
State
StepIt
Stop
StopHotLink
StopNavigation
StopServerDDE
String
Submit
SuspendTransaction (obsolete)
SymmetricDecrypt
SymmetricEncrypt
SymmetricGenerateKey
Synchronize
SyntaxFromSQL
SystemRoutine
TabPostEvent
TabTriggerEvent
Tan
Text
TextLine
Time
Timer
ToAnsi
Today
Top
TotalColumns
TotalItems
TotalSelected
ToUnicode
TraceBegin
TraceClose
TraceDisableActivity
TraceEnableActivity
TraceEnd
TraceError
TraceOpen
TraceUser
TriggerEvent
TriggerPBEvent
Trim
TrimW (obsolete)
Truncate
TrustVerify (obsolete)
TypeOf
Uncheck
Undo
UnitsToPixels
UnregisterEvent
UpdateLinksDialog
Upper
UpperBound
UrlDecode
UrlEncode
WebBrowserGet
WebBrowserSet
Which
WordCap
WorkSpaceHeight
WorkSpaceWidth
WorkSpaceX
WorkSpaceY
Write
XMLParseFile
XMLParseString
Year
Yield
Zoom