April 13, 2012

Chr - XpressDox

This function can be used to return a character based on its numeric (Unicode) value.

Command structure:

«Chr(13)»

 

Examples of usage:

«Chr(13)»
This will insert a carriage return.

 

Some further examples:

  • Format an address block in the questionnaire:
    Chr will probably only be used in the context of building up a string where the character can’t be typed directly.
    One such application is the building of a set of address lines into a block which can be displayed using the InsertFormattedText command.

 

  • The command below assumes that values have been captured into AddressLine1 and AddressLine2, and the concat will join the two together, separated by a carriage-return character Chr(13). The concat is executed when the focus in the interview leaves the field for capturing AddressLine2 (see the OnExitSet article for an explanation of that command)
    «OnExitSet(AddressLine2,AddressBlock,Value,,concat(AddressLine1,Chr(13),AddressLine2),,EvenWhenNotEmpty)»

 

Related Articles:

Use chr to make an apostrophe

Capture a multi-line address in one field

The OnexitSet and OnEnterSet commands