Default LiveBindings Methods

From RAD Studio
Jump to: navigation, search

Go Up to Using Custom Format and Parse Expressions in LiveBindings


RAD Studio provides the following methods that you can use in LiveBindings format and parse expressions:

Method Description

CheckedState(check box)

Evaluates a VCL check box and returns a string with one of the following values:

  • 'True' if the State of the check box is cbChecked.
  • 'False' if the State of the check box is cbUnchecked.
  • '' if the State of the check box is cbGrayed.

DBUtils_ActiveRecord(dataset)

Evaluates a dataset and returns the index of the current record.

DBUtils_BoolValue(value)

Returns the specified value as a boolean.

DBUtils_ValidRecNo(dataset, index)

Returns:

  • The specified index if it exists in the specified dataset.
  • An existing index of the dataset if the specified index does not exist in the dataset.
  • -1 if the first parameter is not a dataset or if the dataset has no records.

Format(format string, argument 1, argument 2, …)

Works as System.SysUtils.Format, except that instead of expecting an array as the second parameter, it takes any argument as an extra parameter.

For example, if in Delphi you have Format('%d %d', [1, 2]), here it would be Format("%d %d", 1, 2).

FormatDateTime(format string, date)

Works as System.SysUtils.FormatDateTime.

IfAll(argument 1, argument 2, …)

Returns True only if all its arguments evaluate to True. Otherwise, it returns False.

IfAny(argument 1, argument 2, …)

Returns True if at least one of its arguments evaluates to True. If all its arguments evaluate to False, it returns False.

IfThen(condition, value if true, value if false)

Returns value if true if condition evaluates to True; otherwise, it returns value if false.

Lookup(scope lookup, key fields, key values, result fields)

Works as Data.Bind.Components.IScopeLookup.Lookup, where scope lookup is an object that implements IScopeLookup and the remaining arguments are the parameters of IScopeLookup.Lookup.

LowerCase(string)

Works as System.UnicodeString.LowerCase.

Math_Max(value 1, value 2)

Works as System.Math.Max.

Math_Min(value 1, value 2)

Works as System.Math.Min.

Round(value)

Works as System.Round.

SelectedDateTime(editor)

Works as Data.Bind.Components.IBindDateTimeEditEditor.SelectedDateTime.

SelectedItem(editor)

Works as Data.Bind.Components.IBindListEditorCommon.GetSelectedItem.

SelectedLookupValue(editor)

Works as Data.Bind.Components.IBindListLookupEditor.GetSelectedLookupValue.

SelectedText(editor)

Works as Data.Bind.Components.IBindListEditorCommon.GetSelectedText.

SelectedValue(editor)

Works as Data.Bind.Components.IBindListEditorCommon.GetSelectedValue.

StrToDateTime(string)

Works as System.SysUtils.StrToDateTime.

SubString(string, index, count)

Works as System.UnicodeString.SubString.

SynchIndex(editor)

Works as Data.Bind.Components.IBindListSynchEditor.GetSynchIndex.

ToNotifyEvent(value)

Converts value into an event.

ToStr(value)

Converts value into a string.

ToVariant(value)

Converts value into a variant.

UpperCase(string)

Works as System.UnicodeString.UpperCase.

See Also