KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Multiline statements do not break tokens
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: September 2, 2010

4D v12 introduced the option to break a single statement over multiple lines in the method editor. This can help with long statements and generally make your code more readable and logical. It's a great boon for developers.

One behavior to keep in mind is that while writing code 4D will let you create your line break anywhere. For example you could write the following code:

C_LONG\
  INT($my\
  _var)


As you write the code 4D will tokenize your commands and variables correctly so they appear "right" (color, font, etc) in the method editor. Once you actually allow 4D to tokenize the code though (by using the Enter key or closing and re-opening the method) 4D will make sure that all commands, methods, and variables are not broken up. For example, after pressing Enter the above method 4D will change the code to be:

C_LONGINT\
  ($my_var\
  )


As you can see the command C_LONGINT has been moved onto one line and the variable $my_var has been moved onto one line. A single token is no longer split over multiple lines.