Показать сообщение отдельно
Старый 21.08.2006, 15:38   #13  
AndyD is offline
AndyD
Участник
КОРУС Консалтинг
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
 
2,560 / 2480 (88) +++++++++
Регистрация: 20.08.2005
X++:
static void Job139(Args _args)
{
    Common      cm;
    InventTable it;
    DictTable   dictTable   =   new DictTable(tablenum(InventTable));
    DictField   dictField;
    str         buf;
    xppCompiler compiler = new xppCompiler();
    ;
    select it where it.ItemId like "1*";
    dictField = dictTable.fieldObject(fieldnum(InventTable, itemId));
    buf = strfmt("%1 getRecord()\n{\n%1 %1;\n;\n select %1 where %1.%2 == \"%3\";\n return %1;}", 
            dictTable.name(), dictField.name(), it.ItemId);
    if (compiler.compile(buf))
    {
        cm = compiler.execute();
//        или
//        cm = runbuf(buf);
        info(cm.(fieldnum(InventTable, itemId)) + "::" + cm.(fieldnum(InventTable, itemName)));
    }
    else
        info(compiler.errorText());
}
Можно использовать функцию runbuf() или метод execute() класса xppCompiler
__________________
Axapta v.3.0 sp5 kr2

Последний раз редактировалось AndyD; 21.08.2006 в 15:41.