Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
method getLimitInfo( uiTarget UIObject )
; -----------------------------------------------
; This routine displays information about active
; ranges and filters on a bound UIObject.
; -----------------------------------------------
var
tcTarget TCursor ; actual table.
datFilter DynArray[] AnyType ; active filter
astrRange Array[] String ; active range
astrIndex Array[] String ; index fields
dstrFinal DynArray[] String ; Final data
liNoItems LongInt ; # array items
siCounter SmallInt ; Counter var
strCounter String ; Counter Var
endVar
errorTrapOnWarnings( Yes )
try
tcTarget.attach( uiTarget )
onFail
msgStop( "Can't Show Limit Conditions",
"Reason: The specified object ( " +
uiTarget.FullName + " ) is " +
" either not a data object or " +
"it's not bound to a table. " +
"Please check your code." )
return
endTry
tcTarget.getRange( astrRange )
liNoItems = astrRange.size()
tcTarget.enumFieldNamesInIndex( astrIndex )
; Check the conditions of the range. There
; are three cases we need to worry about: no
; range, one range condition, multiple range
; conditions. The first two cases are handled
; easily enough, but the latter requires some
; effort, due to the way conditions are
; reported by getRange.
switch
case liNoItems = 0 : ; No range is applied
dstrFinal[ "Range" ] = "<None>"
; One condition is applied to first field.
case liNoItems = 1 :
dstrFinal[ "Range" ] =
astrIndex[ siCounter ] + " Field: " +
astrRange[ 1 ]
; A range is applied to first field.
case liNoItems = 2 :
dstrFinal[ "Range" ] =
astrIndex[ 1 ] + " Field: " +
astrRange[ 1 ] + ", " +
astrRange[ 2 ]
; a range on the final field of the index
otherwise :
for siCounter from 1 to liNoItems - 1
dstrFinal[ "Range Field " +
String( siCounter ) ] =
astrIndex[ siCounter ] + ": " +
astrRange[ siCounter ]
endFor
dstrFinal[ "Range Field " +
String( siCounter ) ] =
dstrFinal[ "Range Field " +
String( siCounter ) ] +
", " + astrRange[ liNoItems ]
endSwitch
; Fetch current filter
tcTarget.getGenFilter( datFilter )
If datFilter.size() = 0 then
dstrFinal[ "Filter" ] = "<None>"
else
forEach strCounter in datFilter
dstrFinal[ "Filter on [" +
strCounter + "]" ] =
datFilter[ strCounter ]
endForEach
endIf
dstrFinal.view( "Current Conditions" )
tcTarget.unAssign()
endMethod