KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Be careful naming variables!
PRODUCT: 4D | VERSION: 11 | PLATFORM: Mac & Win
Published On: November 24, 2010

4D v11 SQL has a cool new feature that gives developers the ability to include expressions in variable names. This can be very useful in automatically assigning existing data values to different variables. For example you could name a variable String([People]Birthday;Internal date long) to display it as "April 28, 1950" if that is desirable.

It's important though to be careful with names because they will now be evaluated and command names in variable names can cause problems. For example if there's a variable on your form named "cancel" then every time the form loads it will immediately close. The "cancel" variable is being evaluated as the CANCEL command and the form gets closed.