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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 24.06.2008, 18:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
axaptapedia: Exception handling
Источник: http://www.axaptapedia.com/Exception_handling
==============

Summary: Added enums and example
<div>When execution a string of code, there is a risk that something may go wrong. Exception handling lets you handle system errors by your own code.


==Try and Catch==
If you are able to predict a block of code, where an exception will occur under certain circumstances, you can use the '''try''' command:


try
{
// Block of code that may fail
}
catch (exception::error)
{
// Do something about this error
}


==Retry==
If you enter '''Retry''' in the '''catch''' block the '''try''' block is executes once more, but be carefull as this can result in a never-ending loop.


==Catch enums==
{| border="1"
|-
!Enum (exception::)
!Description
|-
|Info
|
|-
|Warning
|
|-
|Deadlock
|
|-
|Error
|
|-
|Internal
|
|-
|Break
|
|-
|DDEerror
|
|-
|Sequence
|
|-
|Numeric
|
|-
|CLRError
|
|-
|CodeAccessSecurity
|
|-
|UpdateConflict
|
|-
|UpdateConflictNotRecovered
|}

==Example==


static void TryCatchTest(Args _args)
{
Map m = new Map(types::Integer, types::String);
str s;
int i;
;

m.insert(0,"Zero");
m.insert(1, "First");
m.insert(2, "Second");
m.insert(4, "Fourth");


for (i=0;i
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Issues concerning X++: Exception handling and transactions Blog bot DAX Blogs 1 14.02.2009 00:46
dax-lessons: Document Handling in AX - setup and Example Blog bot DAX Blogs 0 27.08.2007 23:00
channel9: Exception handling in X++ Blog bot DAX Blogs 18 27.02.2007 10:54
casperkamal: Channel 9 Update - Screen Cast Exception handling Blog bot DAX Blogs 0 31.01.2007 21:00
SysDictCoder: Axapta error handling and database transactions Blog bot DAX Blogs 0 28.10.2006 16:47
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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