![]() |
#1 |
Участник
|
axaptapedia: Trap typecast
Источник: http://www.axaptapedia.com/Trap_typecast
============== Summary: caution trap in implicit typecast int64 to boolean == Typecast from int64(RecId) to boolean == (tested in DynamicsAX 2009) the implicit typecast from int/int64 to boolean is often used in ax sources... select * from table where table.field == blabla if (table.recid) public boolean exist( EDT _value) { return (select * from table where table.field == _value).recId; } BUT..... when the RecId (as 64bit integer) last 8 bits are 0 the typecast results in a false even though the RecId is not 0 so, take a look at the bestpractice (design patterns for table exist method) '''when you'll need a boolean, than use a boolean expression !!!''' if (table.RecId != 0) [[category:caution trap]] Источник: http://www.axaptapedia.com/Trap_typecast
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
Теги |
ax2009, ax4.0, int64, recid, баг, приведение типов, ядро |
|
![]() |
||||
Тема | Ответов | |||
axaptapedia: Tutorial Password | 1 | |||
axcoder: PowerShell + Ax | 1 | |||
axaptapedia: Load Web Documents | 1 | |||
axcoder: AxPath is supported by axaptapedia | 0 |
|