KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Create a Check/Uncheck All in a listbox
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: April 15, 2005

Compatible with 4D 2004.x

The new List Box in 4D 2004 supports columns of type Boolean. Furthermore, 4D can natively display this column as either text or a convenient check box. You may want to provide the user with a quick way to select/deselect all of the check boxes. Here's are two code snippets to achieve this:

`Check All

C_LONGINT($find;$i)

$find:=Find in array(aCheckbox;False)

If ($find>0)

  For ($i;1;Size of array(aCheckbox))

        aCheckbox {$i}:=True

  End for

End if


`Uncheck All


C_LONGINT($find;$i)


$find:=Find in array(aCheckbox;True)

If ($find>0)

  For ($i;1;Size of array(aCheckbox))

         aCheckbox {$i}:=False

  End for

End if