Hello,
Unless I miss something here is what happens:
If I put some opimization switches in project-> project options-> compiler options-> custom options they work fine.
But because I dont want them there, if I remove them from there and put them in the main program as {$OPTIMIZATION some opimization switches} they don't work.
In both cases, in the project-> project options-> compiler options-> compilation and linking, the optimization level is set to zero (in order to choose exactly what optimizations I need.)
When I put them in the custom options, the progam runs significantly faster.