Links

Sal

PPJ.Runtime.Sal
Namespace: PPJ.Runtime
Assembly: PPJ.Runtime.49 (4.9.0.0)
Contains all Sal.* static functions.
C#
VB.NET
public class Sal
Public Class Sal

Properties

Interpreter

ScriptEngine: Returns the instance of the interpreter used by SalCompileAndEvaluate.

SalReportType

Type: Returns/Sets the type of the ISalReport implementation.

Methods

Abort(exitCode)

Halts processing of the current menu action, message action, or application action.
Parameter
Type
Description
exitCode
SalNumber
The status of the exit performed by Abort(). Not used.
Returns: SalBoolean. AbortException
Use this function when you want to terminate the current calling sequence without returning a status. For example, if your application is several layers into internal function calls and an error occurs, this will terminate the current calling sequence of functions and leaves the application in the state it was prior to the first function call of that sequence.

ActiveXAutoErrorMode(on)

Turns on/off automatic COM error handling.
Parameter
Type
Description
on
Returns: SalBoolean.

ActiveXDoVerb(ctrl, verb, size)

Perform one of the object's enumerated actions.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
verb
SalNumber
size
Returns: SalBoolean.

ActiveXGetObject(ctrl, obj)

Returns the COM object for the specified AX control.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
obj
SalObject
Returns: SalBoolean.

AppDisable()

Disables input to all open forms.
Returns: SalBoolean. true if the function succeeds and false if it fails.
Use AppDisable and AppEnable when there are multiple applications running simultaneously and you want to control which application receives user input.

AppEnable()

Enables input to all open forms that were disabled.
Returns: SalBoolean. true if the function succeeds and false if it fails.
Use AppDisable and AppEnable when there are multiple applications running simultaneously and you want to control which application receives user input.

AppFind(name, activate)

Finds a visible top-level window.
Parameter
Type
Description
name
SalString
The name of the application without the extension.
activate
If you set activate to true, AppFind() also activates the application's window.
Returns: SalWindowHandle. the window
If you specify the calling application's name in AppFind(), it can only find another running instance of it. You can use this feature to prevent more than one instance of an application running. If there are multiple instances of a single application, AppFind finds and returns the window handle of the first instance it finds If an application has multiple top-level windows, AppFind returns the handle of the first top-level window it finds. Calling AppFind() multiple times does not always return the handle of the same window. If an application does not have visible windows, then AppFind() cannot find it.

ArrayAvg(array)

Returns the average value of all the numbers in an array.
Parameter
Type
Description
array
The name of an array of numbers.
Returns: SalNumber. the average value in an array of numbers.

ArrayDimCount(array, dim)

Parameter
Type
Description
array
SalArray
dim
Returns: SalBoolean.

ArrayGetLowerBound(array, dim, bound)

Parameter
Type
Description
array
SalArray
dim
SalNumber
bound
Returns: SalBoolean.

ArrayGetUpperBound(array, dim, bound)

Parameter
Type
Description
array
SalArray
dim
SalNumber
bound
Returns: SalBoolean.

ArrayIsEmpty(array)

Determines if a dynamic array contains data.
Parameter
Type
Description
array
SalArray
The name of the array to query.
Returns: SalBoolean. true if the array contains no data and false if it is has data.

ArrayMax(array)

Returns the maximum value in an array of numbers.
Parameter
Type
Description
array
The name of an array of numbers.
Returns: SalNumber. the maximum value in an array of numbers.

ArrayMin(array)

Returns the minimum value in an array of numbers.
Parameter
Type
Description
array
The name of an array of numbers.
Returns: SalNumber. the minimum value in an array of numbers.

ArrayQueryBounds(array, min, max)

Parameter
Type
Description
array
SalArray
min
max
Returns: SalNumber.

ArraySetBounds(array, lower, upper)

Sets the lower and upper bound of an array for the first dimension only. NOTE: In SAL this function was named SalSetArrayBounds().
Parameter
Type
Description
array
SalArray
The name of the array to query.
lower
SalNumber
The new lower bound.
upper
SalNumber
The new upper bound or AC_Dynamic.
Returns: SalBoolean. bOk

ArraySetUpperBound(array, dim, bound)

Sets the upper bound of an array. The first dimension is 1.
Parameter
Type
Description
array
SalArray
The name of the array.
dim
SalNumber
Number of the dimension. The first dimension is one, the second is two, and so on.
bound
SalNumber
Upper bound value.
Returns: SalBoolean. true if the function succeeds and false if it fails.
When you call this function for a dimension other than the first, most of the array's data must be copied. There can be a performance cost when you call this function for any dimension but the first one.

ArraySum(array)

Returns the sum of the elements in an array of numbers.
Parameter
Type
Description
array
The name of an array of numbers.
Returns: SalNumber. the sum of the elements in an array of numbers.

BringWindowToTop(ctrl)

Brings a window to the top of all overlapping windows.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: SalBoolean. true if the function succeeds and false if it fails.

CenterWindow(ctrl)

Centers a window. If the window is a top-level window, it centers it on the desktop. If the window is a child window, it centers it on top of its parent.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: SalBoolean. true if the function succeeds and false if it fails.

ClearField(ctrl)

Clears the value from a data field, multi line field, or table window column.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: SalBoolean. true if the function succeeds and false if it fails.

ColorFromRGB(red, green, blue)

Composes a color from red, green, and blue values.
Parameter
Type
Description
red
SalNumber
A number from 0 to 255.
green
SalNumber
A number from 0 to 255.
blue
SalNumber
A number from 0 to 255.
Returns: SalNumber. the color created.

ColorGet(ctrl, colorIndex)

Gets a window's color.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
colorIndex
SalNumber
The color part of the control, represented by one of these constants: COLOR_IndexCellTextCOLOR_IndexTransparentCOLOR_IndexWindowCOLOR_IndexWindowText
Returns: SalNumber. the color
If you specify COLOR_IndexTransparent in the second parameter and the transparent color is not set, ColorGet() returns COLOR_None.

ColorGetSysColor(colorIndex)

Gets a system color.
Parameter
Type
Description
colorIndex
SalNumber
The color of a part of the window, represented by one of these constants: COLOR_SysWindowCOLOR_SysWindowFrameCOLOR_SysWindowText
Returns: SalNumber. the color

ColorSet(ctrl, colorIndex, colorValue)

Sets a window's color.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
colorIndex
SalNumber
The color of a part of the window, represented by one of these constants: COLOR_IndexCellTextCOLOR_IndexTransparentCOLOR_IndexWindowCOLOR_SysWindowText
colorValue
SalNumber
A user-defined value, a value formulated using ColorFromRGB or any of the predefined windows colors. To turn off the transparent color, specify COLOR_None Note: When specifying an explicit RGB color, the COLORREF value has a hexadecimal form of 0x00bbggrr.
Returns: SalBoolean. true if the function succeeds and false if it fails.

ColorToRGB(colorValue, red, green, blue)

Parameter
Type
Description
colorValue
SalNumber
red
green
blue
Returns: SalBoolean.

ColorToRGB(color, red, green, blue)

Parameter
Type
Description
color
Color
red
green
blue
Returns: SalBoolean.

CompileAndEvaluate(expression, error, errorPos, numReturn, sReturn, dtReturn, windowReturn, inhibitErrors, context)

Parameter
Type
Description
expression
SalString
error
errorPos
numReturn
sReturn
dtReturn
windowReturn
inhibitErrors
context
Object
Returns: SalNumber.

ContextBreak()

Deprecated: Use this. Not supported.
Returns: SalString.

ContextCurrent(context)

Returns an instance of SalStringContext wrapping the current context reference.
Parameter
Type
Description
context
Object

ContextMenuSetPopup(ctrl, menuName, flags)

Defines a named popup menu that displays automatically when a window receives SAM_ContextMenu.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
menuName
SalString
A named menu defined in one of the Named Menus section in ctrl, ctrl's MDI window parent, or Global Declarations.
flags
SalNumber
Set this to CM_TableCell to replace the default menu that Windows displays when the mouse pointer is in an editable table window cell. Otherwise, set this to zero.
Returns: SalBoolean. true if this function succeeds and false otherwise.
For some windows, this function also affects how the window processes a right mouse button click: List box-Right click selects the line under the cursor.If the line is already selected, there is no effect. Combo box-For a combo box where the list is always displayed, the behavior is the same as for a list box. Table window-Right click selects the row under the cursor. If the row is already selected there is no effect.

ContextMenuSetPopup(ctrl, menuType, flags)

Defines a named popup menu that displays automatically when a window receives SAM_ContextMenu.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
menuType
Type
the Type of the menu
flags
SalNumber
Set this to CM_TableCell to replace the default menu that Windows displays when the mouse pointer is in an editable table window cell. Otherwise, set this to zero.
Returns: SalBoolean. true if this function succeeds and false otherwise.

CreateWindow(wndToCreate, parent, parameters)

Creates modeless dialog boxes, MDI windows, form windows, and top-level table windows at runtime.
Parameter
Type
Description
wndToCreate
Type
The name of the window to create.
parent
Control
The name of the parent window. Specify hWndNULL if there is no owner window. Note that if you create a top-level form inside a MDI window, then that MDI window will always own the form.
parameters
Object[]
The window parameters.
Returns: SalWindowHandle. the new window.
If you specify a parent, the new window always displays on top of its parent, closes when its parent closes, and hides when its parent is minimized. CreateWindow can pass data to and from the window being created by accepting a variable number of parameters. The data types of these parameters must match the parameter data types of the window being created. You can use window parameters to return information from the window being created by using a reference.

CreateWindow(formName, parent, parameters)

Creates modeless dialog boxes, MDI windows, form windows, and top-level table windows at runtime.
Parameter
Type
Description
formName
SalString
The name of the window to create.
parent
Control
The name of the parent window. Specify hWndNULL if there is no owner window. Note that if you create a top-level form inside a MDI window, then that MDI window will always own the form.
parameters
Object[]
The window parameters.
Returns: SalWindowHandle. the new window.
If you specify a parent, the new window always displays on top of its parent, closes when its parent closes, and hides when its parent is minimized. CreateWindow can pass data to and from the window being created by accepting a variable number of parameters. The data types of these parameters must match the parameter data types of the window being created. You can use window parameters to return information from the window being created by using a reference.

CreateWindow(formName, parent)

Creates modeless dialog boxes, MDI windows, form windows, and top-level table windows at runtime.
Parameter
Type
Description
formName
SalString
The name of the window to create.
parent
Control
The name of the parent window. Specify hWndNULL if there is no owner window. Note that if you create a top-level form inside a MDI window, then that MDI window will always own the form.
Returns: SalWindowHandle. the new window.
If you specify a parent, the new window always displays on top of its parent, closes when its parent closes, and hides when its parent is minimized. CreateWindow can pass data to and from the window being created by accepting a variable number of parameters. The data types of these parameters must match the parameter data types of the window being created. You can use window parameters to return information from the window being created by using a reference.

CreateWindowEx(wndToCreate, parent, left, top, width, height, flags, parameters)

Creates a form window, dialog box, or table window as a child of another form window, dialog box, or toolbar at runtime.
Parameter
Type
Description
wndToCreate
Type
The name of the window to create.
parent
Control
The name of the parent window. Specify hWndNULL if there is no owner window. Note that if you create a top-level form inside a MDI window, then that MDI window will always own the form.
left
SalNumber
Position of the x-coordinate of the upper-left corner of the window in form units.
top
SalNumber
Position of the y-coordinate of the upper-left corner of the window in form units.
width
SalNumber
Width of the window in form units.
height
SalNumber
Height of the window in form units.
flags
SalNumber
You can combine these flags with the '|' operator. CREATE_AsChild: Create the window as a child of parent which must be a form, dialog box or tool bar. CREATE_Border: When used with CREATE_AsChild, the window will have a border. CREATE_Hidden: Create the window, but do not show it.
parameters
Object[]
The window parameters.
Returns: SalWindowHandle. the new window.
If you specify a parent, the new window always displays on top of its parent, closes when its parent closes, and hides when its parent is minimized. CreateWindowEx can pass data to and from the window being created by accepting a variable number of parameters. The data types of these parameters must match the parameter data types of the window being created. You can use window parameters to return information from the window being created by using a reference.

CreateWindowEx(formName, parent, left, top, width, height, flags)

Creates a form window, dialog box, or table window as a child of another form window, dialog box, or toolbar at runtime.
Parameter
Type
Description
formName
SalString
The name of the window to create.
parent
Control
The name of the parent window. Specify hWndNULL if there is no owner window. Note that if you create a top-level form inside a MDI window, then that MDI window will always own the form.
left
SalNumber
Position of the x-coordinate of the upper-left corner of the window in form units.
top
SalNumber
Position of the y-coordinate of the upper-left corner of the window in form units.
width
SalNumber
Width of the window in form units.
height
SalNumber
Height of the window in form units.
flags
SalNumber
You can combine these flags with the '|' operator. CREATE_AsChild: Create the window as a child of parent which must be a form, dialog box or tool bar. CREATE_Border: When used with CREATE_AsChild, the window will have a border. CREATE_Hidden: Create the window, but do not show it.
Returns: SalWindowHandle. the new window.
If you specify a parent, the new window always displays on top of its parent, closes when its parent closes, and hides when its parent is minimized. CreateWindowExFromStr can pass data to and from the window being created by accepting a variable number of parameters. The data types of these parameters must match the parameter data types of the window being created. You can use window parameters to return information from the window being created by using a reference.

CreateWindowExFromStr(formName, parent, left, top, width, height, flags)

Creates a form window, dialog box, or table window as a child of another form window, dialog box, or toolbar at runtime.
Parameter
Type
Description
formName
SalString
The name of the window to create.
parent
Control
The name of the parent window. Specify hWndNULL if there is no owner window. Note that if you create a top-level form inside a MDI window, then that MDI window will always own the form.
left
SalNumber
Position of the x-coordinate of the upper-left corner of the window in form units.
top
SalNumber
Position of the y-coordinate of the upper-left corner of the window in form units.
width
SalNumber
Width of the window in form units.
height
SalNumber
Height of the window in form units.
flags
SalNumber
You can combine these flags with the '|' operator. CREATE_AsChild: Create the window as a child of parent which must be a form, dialog box or tool bar. CREATE_Border: When used with CREATE_AsChild, the window will have a border. CREATE_Hidden: Create the window, but do not show it.
Returns: SalWindowHandle. the new window.
If you specify a parent, the new window always displays on top of its parent, closes when its parent closes, and hides when its parent is minimized. CreateWindowExFromStr can pass data to and from the window being created by accepting a variable number of parameters. The data types of these parameters must match the parameter data types of the window being created. You can use window parameters to return information from the window being created by using a reference.