SetVr – XpressDox

SetVr sets the value of an XpressDox variable, and removes the paragraph.

 

Reference material:

Please read through this article to understand the difference between data elements and variables.

And this article for an overview of working with variables in an XpressDox template.

And for reference, here is a post containing a comprehensive list of all the commands about variables.

 

SetV / SetVr

Where SetV sets the value of a variable, it does leave behind the paragraph it is in. Should you want to also remove the paragraph then it might be better to use SetVr. It is often easier to read the XpressDox variables when they are on new lines, in which case you should use SetVr.

The below example makes use of SetVr, as well as IncrementVr which has the same principle of deleting the paragraph after the XpressDox command has been executed.


«SetVr('supportMother',0)»
«SetVr('supportFather',0)»

«ForEach(Item)»
Description: «Description»
Amount: «FormatNumber(Amount)»
«ChooseFromHzRDBList(ChildSupport,,Mother,Father)»«ChildSupport»

«If(ChildSupport = 'Mother')»
«IncrementVr('supportMother',Amount)»
«End()»
«If(ChildSupport = 'Father')»
«IncrementVr('supportFather',Amount)»
«End()»

«End(ForEach)»

Total to be paid by the Mother: «FormatNumber(GetV('supportMother'))»

Total to be paid by the Father: «FormatNumber(GetV('supportFather'))»