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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.01.2009, 20:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,487 / 846 (79) +++++++
Регистрация: 28.10.2006
gatesasbait: Exception::Break in while loop
Источник: http://gatesasbait.spaces.live.com/B...B9F5!290.entry
==============

 
Good morning
 
I noticed something interesting yesterday. When breaking execution while running a loop (by pressing ctrl-break) an Exception::Break is thrown if 'Yes' is clicked on the resulting break prompt. Sometimes even if the exception is caught, the execution stops, other times it will continue with no apparent reason. Here's the example:
 
public static void whileBreak(Args _args)
{
    int i = 1;
    #define.dosomething(i++; i--;)
    ;
    while (i < 1000000)
    {
        try
        {
            i++;
            #dosomething
            sleep(50);
            #dosomething
        }
        catch (Exception::Break)
        {
            info("Break caught.");
        }
    }
}
 
If we want to be sure the execution will stop, we need to add another 'throw' inside the 'catch' statement. Also note that adding any breakpoint seem to change the behavior of the try-catch.


Источник: http://gatesasbait.spaces.live.com/B...B9F5!290.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Issues concerning X++: Exception handling and transactions Blog bot DAX Blogs 1 14.02.2009 00:46
gatesasbait: AP Posting fails because of security setup in Dynamics Ax 4 Blog bot DAX Blogs 0 03.02.2009 02:07
gatesasbait: How to temporarily suppress infolog messages in Dynamics Ax (deux) Blog bot DAX Blogs 7 28.01.2009 17:45
axaptapedia: Exception handling Blog bot DAX Blogs 0 24.06.2008 18:05
gatesasbait: Forcing specific layers to compare in Ax 4.0x Blog bot DAX Blogs 0 18.12.2007 19:50

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

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

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