xsharp.eu • epDBU DBF Administration tool - Page 2
Page 2 of 2

Re: epDBU DBF Administration tool

Posted: Mon Mar 30, 2026 10:32 am
by ic2
Hello Robert,
robert wrote: Sat Mar 28, 2026 8:23 am How did you declare bFor and bWhile?
There is a different in X# (and VO) between CodeBlock and _Codeblock. The first is for compile time codeblocks and the second for macro compiled code blocks.
It seems that it has been changed through time as the declaration looks as follows:

Code: Select all

LOCAL bFor, bWhile AS _CODEBLOCK //USUAL //CODEBLOCK
Unfortunately I have not documented why it changed. It must have been changed from Codeblock to _Codeblock to get it working at some time (which it did, at least 5 years ago) and it doesn't work anymore in the current X# version.

I checked my VO code and see that I only defined (compile time) codeblocks (not often used anyway), so not the _CodeBlock. But one (working) sample of using such a CodeBlock in VO is:

Code: Select all

lBlok1 := {||AScan(aRel,oDBDCSUb:FIELDGET(#relatie))<>0}
How could that codeblock then be resolved at compile time? Array aRel and the value from a DBF field are retrieved at execution time so that looks like a macro to me. How could that work then with AS CodeBlock ?

Dick

Re: epDBU DBF Administration tool

Posted: Mon Mar 30, 2026 10:37 am
by robert
Dick,

Code: Select all

lBlok1 := {||AScan(aRel,oDBDCSUb:FIELDGET(#relatie))<>0}
This is a compile time code block.
Macros are strings that are converted into a codeblock at runtime
If you change the declaration to

Code: Select all

LOCAL bFor, bWhile AS CODEBLOCK 
then it works

Robert