KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Clear cs.Singleton.me from the expression pane before debugging
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: April 7, 2025

When working with a singleton class, it is common to save the expression "cs.Singleton.me" (where "Singleton" is a singleton user class) in the expression pane of the debugger to quickly verify the value of an instantiated singleton throughout development. Note that the class singleton is instantiated at the first call of either cs.Singleton.new() or of cs.Singleton.me. Calling cs.Singleton.me is just like callling cs.Singleton.new() without any parameters.

If the expression happens to be saved in the debugger's expression pane, and the debugger is triggered before the class singleton is instantiated, the instantiation will occur within the debugger. This could run into issues if the singleton class constructor expects parameters when instantiated. Thus, it is a good idea to clear any saved cs.Singleton.me expressions from the debugger, especially when planning to restart the application.