Salesforce

AStr (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

AStr (Magic xpa 4.x)

Applies a selected format to a string value.

Syntax:

AStr(source string, format string)

Parameters:

'source string ' The string value to be formatted.

'format string ' The string value that determines the format of the source string value.

The characters below are placeholders or modify a corresponding character:

  • X – Any character

  • H – Any character

  • # – Any character

  • U – Corresponding character is switched to uppercase

  • L – Corresponding character is switched to lowercase

The A character, used for Auto Skip in an Edit field, is ignored.

Numbers define the repetition of the preceding format character. If a format character does not precede the number it will repeat the number of times the X format character appears.

For example: The format of 2@3U5 is the same as XX@@@UUUUU.

The backslash, \, character lets you define an operator as a fixed character.

For example: Astr('abcd','2@3A\U\5\A') returns 'ab@@@U5A'.

If the total length of the character placeholders provided in the format string is smaller than the source string length, the remaining characters are truncated.

Returns:

The modified source string value determined by the format string.

Example:

AStr('9141501212ext333', '(XX)XXXX-XXXX UUU XXX') formats the source string to: (91)4150-1212 EXT 333.

See also:

The Online and Rich Client Samples projects (program ST01, ST04, RST01 and RST04)

Directives for Alpha Pictures

Reference
Attachment 
Attachment