Показать сообщение отдельно
Старый 28.05.2009, 13:28   #17  
Eldar9x is offline
Eldar9x
MCTS
Аватар для Eldar9x
Oracle
MCBMSS
 
1,064 / 166 (8) ++++++
Регистрация: 29.09.2006
Адрес: Казань
до кучи

X++:
    XInfo                   xInfo = new XInfo();
    TreeNode                obj;
    int                     i, j;
    TreeNodeIterator        it;
    DictMethod              method;
    str                     source;
    container               con;
    str                     prmType, prmName, prmDefValue;
    ;
    obj =  xInfo.rootNode();
    obj = obj.AOTfindChild('Data Dictionary');
    obj = obj.AOTfindChild('Tables');
    obj = obj.AOTfindChild('AddressTrans_RU');
    obj = obj.AOTfindChild('Methods');
    setprefix("EmplLedger_RU");
    it = obj.AOTiterator();
 
    obj = it.next();
    while (obj)
    {
        setprefix(obj.AOTname());
        source = obj.AOTgetSource();
        source = strrem(source, "\n");
        i = strscan(source, "(", 1, 999);
        source = substr(source, i+1, strscan(source, ")", 1, 999)-i-1);
        con = source ? str2con(source, ",", true) : connull();
        if (conlen(con))
        for (i = 1; i <= conlen(con); i++)
        {
            source = strLRTrim(conpeek(con, i));
            j = strscan(source, " ", 1, 999);
            prmType = strLRTrim(substr(source, 1, j-1));
            source = strLRTrim(substr(source, j+1, 999));
            j = strscan(source, "=", 1, 999) ? strscan(source, "=", 1, 999) : strscan(source, " ", 1, 999) ;
                prmName = strLRTrim(substr(source, 1, j ? j-1 : 999));
 
            info(strfmt("%1 - %2", prmType, prmName));
        }
        else
            info("Нет параметров");
        obj = it.next();
    }
Работает одинаково, что в 3-ке, что в 4-ке.
При желании можно вытащить и значение по умолчанию