Tuesday 8 January 2013

Microsoft Dynamics AX 2012 R2 - any2Str Function


Converts an anytype value to a str value.


Function

  • str any2Str(anytype object)

Parameters

  • Parameter: object
  • Description: The value to convert.
The object parameter can be of most data types, but useful output is obtained from input elements of the date, int, and enum types.


Return Value

  • A str value.

Example

  • X++
static void any2StrExample(Args _args)
{
    str myStr;
    anytype a;
    ;
  
    a = "Any to string";
    myStr = any2Str(a);
    Global::info(strFmt("%1 is output, from input of Any to string as a str value", myStr));

    a = NoYes::Yes;
    myStr = any2Str(a);
    Global::info(strFmt("%1 is output, from input of NoYes::Yes as an enumeration", myStr));


}
/****Infolog Display
Message (09:08:46 am)
Any to string is output, from input of Any to string as a str value
1 is output, from input of NoYes::Yes as an enumeration
****/

My above blog is based on Microsoft's Official information.

I hope this blog about 'Microsoft Dynamics AX 2012 R2 - any2Str Function' was informative. Please feel free to leave your comments.

No comments:

Post a Comment