Apply to selection. Changes in syntax sensibility v15 vs v12?


I am trying to figure out why following do not work in v15R5 (interpreted mode),
but has worked in v12 (compiled mode) for many years.
I get an syntax error on the row with apply to selection: 4D is expecting a field, variable
(and displays the code: $2->:=$4->)
The row with the query seems fine.

This doesn’t seem to work in v15R5.

C_POINTER($1;$2;$3;$4) //$1=tableptr, $2=fieldptr, $3,4 = ptr to text var.
APPLY TO SELECTION($1->;$2->:=$4->)
USE SET(“LockedSet”)
Until (Records in set(“LockedSet”)=0)

If I modify the code to following there is no syntax error


APPLY TO SELECTION($1->;$fieldptr->:=$new)
USE SET(“LockedSet”)
Until (Records in set(“LockedSet”)=0)

There is no problem to compile the code.

Best Regards

Magnus Torell

Product :4D - 4D Server
4D : v15R5
OS : Mac OS X

Don’t ask me why exactly, but it is strongly recommended not to use parameters, but copy of parameters in local variables to pass them. Most probably, inside 4D, a parameter and a local variable are quite different stuff.

The way you’ve modified your code is OK now and was wrong before.

Thanks Arnaud,

OK I will change style accordingly.
I suspected that lacking of parentheses in the “correct” place
was the cause. I have read that things could depend on that,
but I did not find a proper place for parentheses when I tried.


Best regards