AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.11.2006, 01:36   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
casperkamal: Parsing Source Code
Источник: http://casperkamal.spaces.live.com/B...CD63!141.entry
==============

 
     Sometimes its required that we parse the source code written in the classes, Axapata has a class that will help us in doing this. SysScanner Class is the one that will do the Job, it has so many options that will help us in parsing the code easily. Here is a small piece of code on that.
 
 
static void JobSysScannerClass(Args _args)
{
    #AOT
    TreeNode        treeNode   = TreeNode::findNode(#Classespath + '\Class1\Check');
    SysScannerClass sc         = new SysScannerClass(treeNode);
    int             lineCnt = 1;
    ;

 
    while (lineCnt < sc.lines())
    {
        print sc.sourceLine(lineCnt);
    }
   
    pause;
}

 
it also has options to find if the code has the standard symbols like ttscommit, ttsbegin, print,
for this you have to use the Macro #tokentypes which has the integer values for all the standard key words
 
..................My first showpiece
 



Источник: http://casperkamal.spaces.live.com/B...CD63!141.entry
Старый 11.01.2007, 12:56   #2  
Russland is offline
Russland
MCTS
Аватар для Russland
MCBMSS
 
267 / 116 (4) +++++
Регистрация: 17.10.2005
Адрес: Донеччина, Україна
Correct code:

X++:
static void JobSysScannerClass(Args _args)
{
    #AOT
    TreeNode        treeNode   = TreeNode::findNode(#Classespath + '\\Class1\\Check');
    SysScannerClass sc         = new SysScannerClass(treeNode);
    int             lineCnt = 1;
    ;

    while (lineCnt <= sc.lines())
    {
        print sc.sourceLine(lineCnt);
        lineCnt++;
    }

    pause;
}
__________________

В глухомани, в лесу Несмотря на красу Дни проводит Лиса Патрикевна. Я никак не пойму Отчего, почему Не пускают куму На деревню
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Kashperuk Ivan: Tool for protecting your Dynamics AX source code Blog bot DAX Blogs 0 12.12.2008 04:07
casperkamal: Using record templates in code for Dynamics Ax 4.0. Blog bot DAX Blogs 0 10.05.2008 19:14
casperkamal: Sending alerts through code without error in Ax Blog bot DAX Blogs 0 24.03.2008 21:05
casperkamal: A small addition to creation of Table throug x++ code in Dynamics Ax Blog bot DAX Blogs 0 03.04.2007 23:11
casperkamal: Code Access security Blog bot DAX Blogs 0 10.11.2006 01:36

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:54.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.