Checkbox on form longint / boolean

Hi

These days I’m trying to use dynamic form objects rather than adding new process variables.

So I tried adding a checkbox to a form without assigning a process variable to it.

It looks like a dynamic variable based checkbox is always a longint. I’m using 4D v17

Is that the case or am I missing a way to type the dynamic variable?

Many thanks.

: Keith WHITE

It looks like a dynamic variable based checkbox is always a longint.

What did you expected? Many years ago it was only Boolean, for some versions now by default numeric.
A check box can have (up to) 3 values. Clicked. Not clicked. Undefined.
0, 1 or 2.

Manual says:
http://doc.4d.com/4Dv17/4D/17/Check-Boxes.300-3743680.en.html
When the user clicks the object, the box is checked. When a check box is checked, it has the value 1. When it is not checked, it has the value 0.

This property is only available for standard check boxes associated with numeric variables — 3D check boxes and check boxes for Boolean fields cannot use the Three-States property (a Boolean field cannot be in an intermediary state).
The variable associated with the check box returns the value 2 when the check box is in the third state.

BTW, with 4D v17, I stopped using dynamic variables.
They was great to avoid process variables, but they was not comfortable to use, always requiring code to use pointers, more difficult to read.

Starting with v17 using Form.mycheckbox is so much easier.
See Form as a kind of form variable.

A check box can have (up to) 3 values. Clicked. Not clicked. Undefined.
0, 1 or 2.

Ah! So it is quite definitely numeric. That makes sense now.

Starting with v17 using Form.mycheckbox is so much easier.

OK, got it.

Thanks Thomas!

Best regards

Keith