The AddProperty method adds a property to the Application object. This is useful if you need to store a custom value for use within Stonefield Query and retrieve it for any purpose.

Syntax

AddProperty(PropertyName as String [, Value as Variant])

Parameters
PropertyName
The name of the property. This must be a unique name, must start with a letter, and can only contain letters, digits, or underscores.

Value
The value to store in the property. This parameter is optional; if it isn't specified, the property is set to False.

Return Value
None.

Example
Suppose the Select script a table uses needs to know if the user is filtering on the CUSTOMERS.TYPEID field (perhaps it has to lookup values in another table). The DataEngine.FilterChanged script could store the value the user is filtering on in a property of the Application object the Select script uses.

Visual FoxPro

lparameters toApplication as SQApplication
local loFilters, lnI, loCondition, liType
loFilters = toApplication.DataEngine.FilterConditions
for lnI = 1 to loFilters.Count
  loCondition = loFilters.Item(lnI)
  if loCondition.FieldName = 'CUSTOMERS.TYPEID'
    liType = loCondition.Values.Item(1)
    toApplication.AddProperty('CustomerTypeFilter', ;
      liType)
  endif
next

VBScript

function Main(Application)
dim Filters, Condition
set Filters = Application.DataEngine.FilterConditions
for I = 1 to Filters.Count
  set Condition = Filters.Item(lnI)
  if Condition.FieldName = "CUSTOMERS.TYPEID"
    TypeID = Condition.Values.Item(1)
    Application.AddProperty("CustomerTypeFilter", _
      TypeID)
  end if
next
end function

JavaScript

function Main(Application, SelectStatement) {
var Filters, I, Condition, TypeID ;
Filters = Application.DataEngine.FilterConditions ;
for (I = 1; I <= Filters.Count; I++) {
  Condition = Filters.Item(lnI) ;
  if (Condition.FieldName = 'CUSTOMERS.TYPEID') {
    TypeID = Condition.Values.Item(1) ;
    Application.AddProperty('CustomerTypeFilter', 
      TypeID) ;
  }
}
}

See Also
Application Object