When you compile a 4DGL file, the compiler generates an executable file with an extension .4XE. When you download the compiled code, the 4XE file gets downloaded to the FLASH or RAM depending on the option selected in the 4D Workshop4 IDE.
When a 4XE program is saved to FLASH, the program will start whenever power is applied.
Note: If #MODE RUNFLASH is added to the start of the program, the program actually executes from FLASH memory. Otherwise, the program in FLASH is loaded into RAM before it is run. A program that is run directly from FLASH runs a little slower than a program run from RAM, but has the advantage of leaving the RAM space free for running child programs.