KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Macros for Inserting If/Else, Case Of, etc. Code Block Templates
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: January 29, 2020

When coding project methods, typing out "If/Else" or "Case of" code blocks may be become tedious. The TAB autocomplete feature makes this easier:



In the method editor, there are macros for inserting "If/Else" and "Case of" templates without having to type anything. Simply click the parchment paper icon:



For example, selecting the "CaseOf" option automatically inserts this template into your code:



There are options for many other types of common control flow templates as well, including While/End while loops, For/End for loops, and Repeat/Until loops.