2022.2

Table Of Contents
this
AStandardscriptorPostPaginationscriptthathasitsscopesetto"Eachmatchedelement"(see"Set-
tingthescopeofascript"onpage813)willbecalledinaloopovertheelementsthatmatchtheselector
ofthescript-theresults(see"results"onpage1301).Insuchascript,thisisanobjectofthetype
QueryResult.Itrepresentsthecurrentelementintheloop.
Note: ThescopeofControlScriptscan'tbeset,becausetheydon'thaveaselector.
Example
Iftheselectorofascriptisp.onlyCanada,anditsscopeissetto"Eachmatchedelement",thescript
willberepeatedforallparagraphsthathavetheonlyCanadaclass;itcanaccessonlyoneparagraph
atatime.Thescriptcouldusethistomanipulateeachparagraph,e.g.hideorshowitdependingon
thevalueofadatafieldCountryinthecurrentrecord:
if (record.fields["Country"] == "CANADA") {
this.show();
} else {
this.hide();
}
Note: Inascriptthathasitsscopesetto"Eachmatchedelement",theresultsobjectisstill
accessible,andcanbeusedinanon-iterativeway(forexample,youcoulduseitslengthprop-
ertytodeterminethetotalnumberofmatchedelements)butiteratingoverresultswillproduce
awarning.
Properties
Field Type Description
id
Number Indexintheresultset,orzeroifthiselementisnotpartofaresultset.
record
Record Representsthecurrentdetailrecordina(possiblynested)detailtableassociatedwithrepeatingrowsin
aDynamicTable.Thispropertyisonlyavailablewhenthisisaroworchildelementofarowina
DynamicTable.(See"DynamicTable"onpage742.)
Ifthis(thecurrentQueryResultinstance)cannotbematchedtoadetailrecord,this.recordisnull.
runningTotal
Number Canbeusedtoupdatearunningtotal.Itisinitializedtozerowhenaloopoverresultsstarts.
Functions
Thefunctionsbelowcanbecalledbytheresultsobjectandbyanyotherresultsetthatisreturnedby
aquery,see"query()"onpage1197.
Page 1237