Home > Ax Technical > Identifying the Type of Variable

Identifying the Type of Variable

<![CDATA[

 
There are cases when we declare a variable of type "anytype" and at run time we may want to make decision based on that, in that case
you can use the "typeof" function to determine the variable type.
 
Hope this example throws some light on it
 
    anytype      testTypeOf;
    ;
  
    switch(typeof(testTypeOf))
    {
        case Types::Record :
                    //Action to pe performed when the type received is table
        case Types::Class    :
                    //Action to pe performed when the type received is table
        case Types::Integer    :
                    //Action to pe performed when the type received is table
    }
 
 

]]>

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: