21.05.2009, 12:05 | #1 |
Участник
|
SysDictCoder: Detecting default values
Источник: http://sysdictcoder.com/blog/detecting-default-values/
============== So I haven’t posted in a long time. I finally fixed some technical issues on the blog and upgraded to a recent version of Wordpress. Let’s start with a quick tip to warm up :) As you know X++ supports methods with default values. In Ax it’s possible to detect when such a default value was used at runtime with prmIsDefault(). To see this for yourself, create a class with a method like this: void someMethod(int i = 1) { ; if (prmIsDefault(i)) { info('Default'); } else { info('Value given'); } } And call it from another method. o.someMethod(); o.someMethod(1); Even though the value is the same in both cases a different info message will be displayed. Now you may be wondering how this can be useful. Some scenarios:
Источник: http://sysdictcoder.com/blog/detecting-default-values/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|