SalBoolean
Namespace: PPJ.Runtime
Assembly: PPJ.Runtime.50 (5.0.0.0)
Represents a SAL Boolean backed by a decimal value and a separate null state.
- C#
- VB.NET
public struct SalBoolean : ValueType, IComparable, IConvertible, IFormattable, INullable, ISalType, IXmlSerializable
Public Structure SalBoolean
Implements ValueType, IComparable, IConvertible, IFormattable, INullable, ISalType, IXmlSerializable
A default-initialized value is non-null zero. Boolean conversion treats any nonzero stored number as true. Comparisons order SAL null before non-null values; ordinary arithmetic uses the stored numbers and does not propagate null.
Example:
using PPJ.Runtime;
SalBoolean enabled = true;
bool flag = enabled; // true
SalBoolean missing = SalBoolean.Null;
bool? optional = missing; // null
SalNumber numeric = enabled; // 1
Constructors
SalBoolean(x)
Initializes a non-null Boolean from a bool value.
| Name | Type | Description |
|---|---|---|
| x | Boolean | The Boolean value; true is stored as one and false as zero. |
Properties
IsNull
Boolean: Gets whether the value represents SAL null.
Value
Decimal: Gets the stored decimal value without applying SAL null semantics.
Methods
Add(x, y)
Adds the stored decimal values.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The left operand. |
| y | SalBoolean | The right operand. |
Returns: SalBoolean. A non-null value containing the sum.
SAL null contributes its stored zero; the result does not preserve null flags. Decimal overflow propagates.
Compare(x, y)
Compares two SAL numeric values, ordering null before non-null values.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The left value. |
| y | SalBoolean | The right value. |
Returns: Int32. A negative value if x precedes y, zero if equal, or a positive value if x follows y.
Two SAL null values compare equal. Non-null values are compared as decimals.
CompareTo(obj)
Compares this value with another numeric value.
| Parameter | Type | Description |
|---|---|---|
| obj | Object | A SalBoolean, a boxed decimal, or null. |
Returns: Int32. A negative value if this value precedes the argument, zero if equal, or a positive value if it follows.
Arguments of the same SAL type use SAL null ordering. Other arguments are passed to Decimal.CompareTo; unsupported types cause ArgumentException.
CompareTo(x)
Compares this value with another numeric value.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The SAL value to compare. |
Returns: Int32. A negative value if this value precedes the argument, zero if equal, or a positive value if it follows.
Uses SAL comparison ordering, with null before non-null.
Divide(x, y)
Divides the stored decimal values.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The dividend. |
| y | SalBoolean | The divisor. |
Returns: SalBoolean. A non-null value containing the quotient.
SAL null contributes its stored zero; the result does not preserve null flags. Decimal overflow propagates. A zero divisor throws DivideByZeroException.
Multiply(x, y)
Multiplies the stored decimal values.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The left operand. |
| y | SalBoolean | The right operand. |
Returns: SalBoolean. A non-null value containing the product.
SAL null contributes its stored zero; the result does not preserve null flags. Decimal overflow propagates.
Negate(x)
Reverses the sign while preserving SAL null.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The value to negate. |
Returns: SalBoolean. The negated number, or SAL null when the argument is null.
Subtract(x, y)
Subtracts the stored decimal values.
| Parameter | Type | Description |
|---|---|---|
| x | SalBoolean | The left operand. |
| y | SalBoolean | The right operand. |
Returns: SalBoolean. A non-null value containing the left value minus the right value.
SAL null contributes its stored zero; the result does not preserve null flags. Decimal overflow propagates.
ToBoolean()
Tests whether the stored number is nonzero.
Returns: Boolean. True for a nonzero value; false for zero, including SAL null.
This conversion does not preserve the SAL null flag.
ToByte()
Converts the stored number to an unsigned byte.
Returns: Byte. The low eight bits of ToInt32.
This conversion does not preserve the SAL null flag.
ToChar()
Converts the stored number to a UTF-16 character.
Returns: Char. The character represented by the low 16 bits of ToInt32.
This conversion does not preserve the SAL null flag.
ToDecimal()
Returns the stored decimal value.
Returns: Decimal. The decimal value, including zero for SAL null.
This conversion does not preserve the SAL null flag.
ToDouble()
Converts the stored number to double precision.
Returns: Double. The floating-point value; precision may be lost.
This conversion does not preserve the SAL null flag.
ToInt16()
Converts the stored number to a signed 16-bit integer.
Returns: Int16. The low 16 bits of ToInt32, interpreted as a signed integer.
This conversion does not preserve the SAL null flag.
ToInt32()
Converts the stored number to a signed 32-bit integer.
Returns: Int32. The integral part, with excess high bits discarded when needed.
Uses the low 32 bits of the truncated decimal magnitude with its sign applied. This conversion does not preserve the SAL null flag.
ToInt64()
Converts the stored number to a signed 64-bit integer.
Returns: Int64. The integral part, truncated toward zero.
Throws OverflowException when the value is outside the signed 64-bit range. This conversion does not preserve the SAL null flag.
ToIntPtr()
Converts the stored number to a pointer-sized integer.
Returns: IntPtr. An IntPtr containing the converted value.
Uses ToInt32 even in a 64-bit process. This conversion does not preserve the SAL null flag.
ToSByte()
Converts the stored number to a signed byte.
Returns: SByte. The low eight bits of ToInt32, interpreted as a signed byte.
This conversion does not preserve the SAL null flag.
ToSingle()
Converts the stored number to single precision.
Returns: Single. The floating-point value; precision may be lost.
This conversion does not preserve the SAL null flag.
ToUInt16()
Converts the stored number to an unsigned 16-bit integer.
Returns: UInt16. The low 16 bits of ToInt32.
This conversion does not preserve the SAL null flag.
ToUInt32()
Converts the stored number to an unsigned 32-bit integer.
Returns: UInt32. The ToInt32 result cast to an unsigned integer.
This conversion does not preserve the SAL null flag.
ToUInt64()
Converts the stored number to an unsigned 64-bit integer.
Returns: UInt64. The integral part, truncated toward zero.
Throws OverflowException when the value cannot be represented as an unsigned 64-bit integer. This conversion does not preserve the SAL null flag.
Used By
| Name | Description |
|---|---|
| Sal.Abort | Signals an application-abort request by throwing AbortException. |
| SalBoolean.Add | Adds the stored decimal values. |
| SalFileHandle.Copy | Copies a file and reports a SAL file-copy status. |
| SalFileHandle.CreateDirectory | Creates a directory and any missing parent directories. |
| SalWindowHandle.DrawMenuBar | |
| SalSqlHandle.CloseAllSPResultSets | Closes the active result set and releases its reader or buffered data. |
| Sql.ClearImmediate | Disconnects the reusable handle used by immediate SQL operations. |
| SalObject.GetLastError | Copies details of the most recently handled exception into an error record. |
| SalSafeArray.Create | Creates a new one-dimensional managed array and replaces the wrapped value. |
| SalVariant.AsActiveX | Converts and replaces the stored value using a supported automation scalar type. |
| SalNavigationBar.AddPane | Creates a navigation pane with the specified name, caption, and state images. |
| SalTreeControl.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalActiveX.AutoErrorMode | Configures automatic error handling for SAL COM object wrappers. |
| SalBackgroundText.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalCheckBox.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalComboBox.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalCustomControl.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalDataField.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalFrame.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalGroupBox.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalHorizontalScrollBar.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalLine.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalListBox.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalRibbonBarMDI.MDIArrangeIcons | Arranges minimized child-window icons in this MDI container. |
| SalRibbonBarBase.DrawMenuBar | UpdateMainMenu applied to this form. |
| SalMultilineField.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalOptionButton.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalPicture.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalPushbutton.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalRadioButton.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalUserControl.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalVerticalScrollBar.BringWindowToTop | Brings this control to the front, or activates it when it is a top-level or MDI form. |
| SalForm.DrawMenuBar | UpdateMainMenu applied to this form. |
| SalFormTableWindow.AnyRows | Checks both grids for a nondeleted row matching the flag filters. |
| SalMDIWindow.MDIArrangeIcons | Arranges minimized child-window icons in this MDI container. |
| SalWindow.GetFormParameter | Gets a form parameter directly from a SalForm. |
| SalTableColumn.DefineCheckBoxColumn | Configures this column as check boxes with mapped cell values. |
| SalTableWindow.AnyRows | Checks both grids for a nondeleted row matching the flag filters. |
| SalQuickFTP.OpenFile | Accepts the remote-file open compatibility request. |
| SalQuickFTP.PutFile | Uploads a local file, optionally starting asynchronously. |
| SalQuickFTP.GetFile | Downloads a remote file with resume enabled. |
| SalQuickTabs.Add | Appends an unnamed tab page. |
| SalQuickTabs.Insert | Inserts an unnamed page while preserving the selected numeric index. |
| SalQuickTabsParent.TabCreate | Handles notification that a QuickTabs frame has been created. |
| SalQuickToolTipCheckBox.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipChildTable.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipComboBox.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipDataField.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipHScrollBar.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipListBox.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipMultilineField.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipOptionButton.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipPicture.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipPushButton.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipRadioButton.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipTableWindow.AddTool | Associates tooltip text and status text with a control. |
| SalQuickToolTipVScrollBar.AddTool | Associates tooltip text and status text with a control. |
| SalToolTipManager.AddTool | Associates tooltip text and status text with a control. |
| SalDDE.Extract | |
| Vis.ArrayFillDateTime | |
| VisCalendar.SetWeekStart | |
| VisCalendarDropDown.GetFocusDate | |
| VisColorPalette.SetFocus | |
| VisColorPaletteDropDown.SetFocus | |
| VisComboBoxBase.SetItemFlags | |
| VisDirListBox.Populate | |
| VisDirTreeListBox.Populate | |
| VisFontNameComboBox.GetSelectedFont | |
| VisFontNameListBox.GetSelectedFont | |
| VisListBoxBase.SetItemFlags | |
| VisListBoxExtension.SetFlags | |
| VisListView.Arrange | |
| VisListViewDropDown.GetEditable | |
| VisOutlineComboBox.SetItemFlags | |
| VisOutlineListBox.SetItemFlags | |
| VisRadioListBox.Add | |
| VisRadioListBox.Insert | |
| VisRadioListBox.AddValue | |
| VisRadioListBox.InsertValue | |
| VisRichEdit.LineScroll | |
| VisSpinField.IsValidNumber | |
| VisSplitter.SetChild | |
| VisSplitterWindow.SetChild | |
| VisTblEx.SetRowColor | |
| XSal.SetWindowImage | |
| XSalHSplitter.SetTopFrame | |
| XSalSplitter.SetBarSize | |
| XSalVSplitter.SetLeftFrame |