Monday, July 14, 2014

Getting a list of all projects

Question: How can i get a list of all projects in a system?

Answer: Use the code snippet below,

static void MSTA_Utility_ExportAllProjects(Args _args)
    SysOperationProgress    progressBar = new SysOperationProgress();

    TreeNode _treeNode;
    TreeNode projectNode;
    TreeNodeIterator iterator;
    int i, a;
    // Initialising progress bar
    progressBar.setCaption("Export To Excel in progress...");

    _treeNode = infolog.projectRootNode();
    _treeNode = _treeNode.AOTfirstChild();

    for(i = 0; i < 2; i++)
        iterator = _treeNode.AOTiterator();
        projectNode =;
        while (projectNode)
            progressBar.setText(strfmt("Project %1", projectNode.treeNodeName()));
            if(String::beginsWith(projectNode.treeNodeName(), "MSTA"))
                info(projectNode.treeNodeName()) ;
            projectNode =;
        _treeNode = _treeNode.AOTnextSibling();



  1. Thank you abdul, your posts will be very helpful for all starters in the sphere of software development. Currently I work at and if I have some interesting experience I'll share a link with you, as well.

  2. Hello!
    Thanks for sharing this, the code snippet for getting the list of all projects will be quite useful for me, because I'm a beginner in this field and want to develop my skills and get some knowledge.