strPrompt Function

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Appends to a string the specified number of period characters followed by a colon and space character.

str strPrompt(str _string, _int len)

Parameters

Parameter

Description

_string

The original string.

_len

The desired final length of the string.

Return Value

A string that looks like a prompt for user input.

Remarks

In atypical cases where the value of the _len parameter is only slightly larger than the length of the original string, top precedence is given to adding the trailing space. The next precedence is given to the colon. The lowest precedence is given to the periods. Negative values for the _len parameter return the input string appended with a trailing space.

  • strPrompt("ab",-1); //Returns "ab ".

  • strPrompt("ab",3); //Returns "ab ".

  • strPrompt("ab",4); //Returns "ab: ".

  • strPrompt("ab",5); //Returns "ab.: ".

  • strPrompt("ab",6); //Returns "ab..: ".

Example

    static void JobStrPromptDemo(Args _args)
    {
        // Printed string is "[abc..: ]"
        print "[", strPrompt("abc", 7), "]";
        pause;
    }

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).