KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: 4D v11 SQL Components and the Scope of 4D System Variables
PRODUCT: 4D | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: April 2, 2009

It is important to note that 4D v11 SQL host databases and components do not share 4D System Variables such as OK, MouseX, MouseY, etc. This means that you cannot use them in component code the same way that you would in a regular database. A couple of examples of that are:

  • It is normal to open a dialog and then depend on the 4D System Variable OK to know if the user pressed the Accept or Cancel buttons. If you open a dialog via a 4D v11 SQL component, the OK variable in the Host database is not set. You have to find out if the user selected Cancel or Accept another way.
  • If in a 4D v11 SQL component you need to know where the user has clicked the mouse, or during a Mouse Moved event, you have to pass MouseX and MouseY as parameters in the call to the component method. You cannot use the System Variables in the component method.