Pages

Banner 468 x 60px

 

Wednesday, November 22, 2017

confind using x++

0 comments
Confind using 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;
}

static void Job38(Args _args)
{
    container       c1 = [1,2,2,3,4,5,6,6,7,7,8];
    container       c2;
    Set             set = new set(Types::Integer);
    SetEnumerator   se;
    int             i;
    ;

    // Load the containre into the set
    for (i=1; i<=conlen(c1); i++)
        set.add(conpeek(c1, i));
    // Get the enumerator for traversal
    se = set.getEnumerator();

    // Unload the set back into the c2 container
    while (se.moveNext())
        c2 += se.current();

    // Output the container
    info(strfmt("%1", con2str(c2)));
}


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;
}

0 comments:

A financial dimension value is based on the LAND-00013 record and has been used on a transaction. You cannot delete the LAND-00013 record AX 2012

 A financial dimension value is based on the LAND-00013 record and has been used on a  transaction. You cannot delete the LAND-00013 record ...