v18R2 bug?

v18R2, Mac

Passing Null as as the “headerVar” parameter to LISTBOX INSERT COLUMN or LISTBOX INSERT COLUMN FORMULA causes an error (59) and the column isn’t created. Writing $ni:=Null and passing $nil as the parameter works fine.

The ability to pass Null as a parameter is new in v18 (the documentation for v17 forbad it, but that line has been removed from the v18 documentation) and works elsewhere.

Seems like a bug to me; have I missed something?


Try this ? :

LISTBOX INSERT COLUMN FORMULA(*;"print";$O_Temp.colPos;$O_Temp.colName;$O_Temp.colFormula;$O_Temp.colDataType;$O_Temp.headerName;$P_Dummy)
OBJECT SET TITLE(*;$O_Temp.headerName;$O_Temp.headerLabel)

It’s a workaround, Bertrand; as I wrote, I’d established that it would avoid the problem (your $P_Dummy is my $nil).

But it does seem to me to be a bug. I’ll file a report.


hi Kikashy

For me, it’s a typo from the documentation. It is said:

To do this, LISTBOX INSERT COLUMN FORMULA accepts a Nil (->[]) pointer as a value for the headerVar

When reordering same words of the same sentence, it becomes clearer:
To do this, LISTBOX INSERT COLUMN FORMULA accepts a Nil pointer ( ->[] ) as a value.

French manual writes:
Pour cela, LISTBOX INSERER COLONNE FORMULE accepte un pointeur Nil (->[]) comme valeur pour les paramètres


The Null function has several guises, but one is the equivalent of a nil pointer. See an example from its documentation (https://doc.4d.com/4Dv18R2/4D/18-R2/Null.301-4802769.en.html, example 3):

If ($p=Null) //equivalent to If (Is Nil pointer($p))


1 Like


Why is this so important?



In the grand scheme of things, of course it’s not. I mention it only because I was bitten by it, so I thought it reasonable that others should know. My reading was that Null could now be used where we used to use a local nil pointer, which would have been nice; but it seems that I was wrong. The runtime error message is rather non-specific, so it took me a while to work out what the problem was.

If nobody else has wandered into the trap, it’s supremely unimportant.