KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Modification for Shared Objects and Collections in 4D
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: February 18, 2025

All modifications to a shared object or collection must be enclosed within a Use...End use block; otherwise, an error will occur.

$s_obj:=New shared object("prop1";"alpha")
Use($s_obj)
$s_obj.prop1:="omega"
End Use


However, All collection functions that modify a shared object or collection automatically include an internal Use...End use block, eliminating the need for manual coding.

$col:=New shared collection()
$col.push("alpha") //.push() internally triggers Use/End use, so no need to do it yourselves