Monday, 4 February 2013

Microsoft Dynamics AX 2012 R2 - conFind Function


Locates the first occurrence of an element or a sequence of elements in a container.

Function

  • int conFind (container container, anytype element,... )

Parameters

  • Parameter: container
  • Description: The container to search.
 
  • Parameter: element
  • Description: One or more elements to search for, separated by commas.
If several elements are specified in the sequence, they must be separated by commas and specified in the correct sequence. The elements can be of any data type.

Return Value

  • Returns 0 if the item was not found; otherwise, the sequence number of the item.

Example

  • X++
static void conFindExample(Args _args)
{
    container c = ["item1", "item2", "item3"];
    int i;
    int j;
    ;

    i = conFind(c, "item2");
    j = conFind(c, "item4");
    print "Position of 'item2' in container is " + int2Str(i);
    print "Position of 'item4' in container is " + int2Str(j);
    pause;
}

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

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

No comments:

Post a Comment