Team Foundation Server (version control)

Microsoft link : http://msdn.microsoft.com/library/ms181368.aspx

Advertisements

Make a lookup for all table in a query

static int pickTableInQuery(str _queryName)
{
    #ResAppl
    #AOT
    #define.DS      ("\\Data Sources")
    #define.NAME    ("Name")

    int             i;
    int             nodeCount;
    str             nameStr;
    container       names;
    str             path;

    Object          formRun;

    TreeNode        node;
    TreeNode        child;
    
    Dictionary      dict = new Dictionary();
    
    void searchDS(str _path)
    {
        TreeNode    mNode;
        TreeNode    mChild;
        int         mCount;
        int         mLoop;
        ;
        
        mNode = TreeNode::findNode(_path);
        if (mNode)
        {
            mChild = mNode.AOTfirstChild();

            mCount = mNode.AOTchildNodeCount();

            for (mLoop = 1; mLoop <= mCount; mLoop++)
            {
                names   += mChild.AOTgetProperty(#NAME);
                searchDS(_path + #AOTRootPath + mChild.AOTgetProperty(#NAME) + #DS);
                mChild = mChild.AOTnextSibling();
            }
        }
    }
    ;

    path = #QueriesPath + #AOTRootPath + _queryName + #DS;

    node        = TreeNode::findNode(path);
    nodeCount   = node.AOTchildNodeCount();
    child       = node.AOTfirstChild();

    formRun     = classfactory.createPicklist();
    formRun.init();

    searchDS(path);

    formRun.choices(names, #ImageTable);
    formRun.caption("@SYS26727");
    formRun.run();
    formRun.wait();

    if (formRun.choice())
    {
        return dict.tableName2Id(formRun.choice());
    }

    return 0;
}

Make a lookup for the Queries

Like all method in Global class (like pickTable)

There is the code for make the same list BUT for the queries.

static str pickQuery()
{
    #ResAppl
    #AOT

    int             i;
    int             nodeCount;
    str             nameStr;
    container       names;

    Object          formRun;

    TreeNode        node;
    TreeNode        child;
    ;

    node        = TreeNode::findNode(#QueriesPath);
    nodeCount   = node.AOTchildNodeCount();
    child       = node.AOTfirstChild();

    formRun     = classfactory.createPicklist();
    formRun.init();

    for (i = 1; i <= nodeCount; i++)
    {
        names  += child.AOTgetProperty("Name");
        child   = child.AOTnextSibling();
    }

    formRun.choices(names, #ImageQuery);
    formRun.caption("@SYS26727");
    formRun.run();
    formRun.wait();

    if (formRun.choice())
    {
        return formRun.choice();
    }

    return '';
}