KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Selecting Code Block Shortcut
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: July 10, 2019

When testing and modifying code it can be useful to highlight a code block. By default, the shortcut to highlight a code block is Command+B on Mac and Control+B on Windows. This can be modified in the preferences:



In the 4D method editor code blocks are everything within the same of subindentation without going out to the parent indent.

For example
Block
   SubBlock1
      SubSubA
   SubBlock1
   SubBlock1
Block
Block
   SubBlock2
      SubSubB
   SubBlock2
   SubBlock2
Block

If the cursor is in any "Block" line, the shortcut will select all lines.

If the cursor is in the one of the three "SubBlock1" lines, the three lines and the child block of "SubSubA" will be highlighted:
SubBlock1
   SubSubA
SubBlock1
SubBlock1

If the cursore is at "SubSubB" and the shortcut is used, only the line at "SubSubB" will be selected.

Using this it can be helpful in commenting or just highlighting a case statment or if block to debug and look over.

Also specifc parts of a line can also be multiple blocks, such as a String, or a list of parameters.