The Run_Once marker allows selecting part of the code that will be executed only the first time the file is executed. After the first execution the contents of this marker will be deleted from memory and will never be restored. If you try to run this code for a second time, it will be skipped.
uses
enigma_ide;
procedure Test;
begin
EP_Marker('run_once_begin');
EP_Marker('run_once_end');
end;
run_once_begin.inc
asm
DB $EB, $08, $72, $75, $6E, $6F, $6E, $63, $65, $42
end;
run_once_end.inc
asm
DB $EB, $08, $72, $75, $6E, $6F, $6E, $63, $65, $45
end;
#include "enigma_ide.h"
#pragma optimize("", off)
void test()
{
EP_Marker("run_once_begin");
EP_Marker("run_once_end");
}
#pragma optimize("", on)
run_once_begin.inc
__asm
{
DB 0xEB, 0x08, 0x72, 0x75, 0x6E, 0x6F, 0x6E, 0x63, 0x65, 0x42
}
run_once_end.inc
__asm
{
DB 0xEB, 0x08, 0x72, 0x75, 0x6E, 0x6F, 0x6E, 0x63, 0x65, 0x45
}
#include "enigma_ide.h"
#pragma optimize("", off)
void test()
{
EP_Marker("run_once_begin");
EP_Marker("run_once_end");
}
#pragma optimize("", on)
Call VarPtr("RUN_ONCE_BEGIN")
Call VarPtr("RUN_ONCE_END")
See markers examples in the installation folder, Examples\MarkerRunOnce subfolder.