Hi Przemek, > It's expected. CL53 DBFCDX ignores codeblock passed to ordCreate() > and recompile string key value. AFAIR few year ago I replicated it
To be precise CL53 DBFCDX/COMIX analyses ordCreate() parameter cExpKey. If it is _simple_ field name and this field _type_ is CHARACTER, then cdxOrderCreate() uses this field value directly without codeblock compiling/execution (likely for speed purpose). In _all_ other cases users bExpKey codeblock is used. I not find this logic very sexy, but it is better to know one exception, when _my_ codeblock supplied is ignored. Then I can instead of ordCreate(, 'T1', 'CODE', {|| STRTRAN(CODE,' ', '_')} ) do ordCreate(, 'T1', '', {|| STRTRAN(CODE,' ', '_')} ) or ordCreate(, 'T1', 'NOTFIELD', {|| STRTRAN(CODE,' ', '_')} ) and codeblock is executed. Say, when dbcreate( TMP_DST, { {"CODE", "N", 20, 0} } ) append: 1000, 2000, 3000 ordCreate(, "T1", "CODE", {|| Padl(CODE,20,'0')} ) Clipper: OrdKey: CODE KEYSIZE: 20 1 CODE: 1000 ORDKEYVAL: 00000000000000001000 2 CODE: 2000 ORDKEYVAL: 00000000000000002000 3 CODE: 3000 ORDKEYVAL: 00000000000000003000 Harbour: OrdKey: CODE KEYSIZE: 20 1 CODE: 1000 ORDKEYVAL: [EMAIL PROTECTED] 2 CODE: 2000 ORDKEYVAL: [EMAIL PROTECTED] 3 CODE: 3000 ORDKEYVAL: _¦p..... When dbcreate( TMP_DST, { {"CODE", "D", 8, 0} } ) append: DATE(), DATE() +1, DATE() +2 ordCreate(, "T1", "CODE", {|| DTOS(CODE)} ) Clipper: OrdKey: CODE KEYSIZE: 8 1 CODE: 11/13/08 ORDKEYVAL: 20081113 2 CODE: 11/14/08 ORDKEYVAL: 20081114 3 CODE: 11/15/08 ORDKEYVAL: 20081115 Harbour: OrdKey: CODE KEYSIZE: 8 1 CODE: 11/13/08 ORDKEYVAL: _B_.Ć... 2 CODE: 11/14/08 ORDKEYVAL: _B_Ć.... 3 CODE: 11/15/08 ORDKEYVAL: _B_ĆĆ... Of course this story about temporary indexes. Best regards, Saulius
_______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour