After ForceDirectories statement, Delphi exits the procedure -


i have simple procedure found problem, while debugging found delphi execute forcedirectories jump directly end of procedure without executing lines after it, why ??

var export_dir: string; grd_idx: integer; begin   export_dir := 'c:\app1\export\';   sysutils.forcedirectories(export_dir);    showmessage('this line executed jump end !!');    grd_idx := 0 pred(pagecontrol1.activepage.componentcount) begin      if (pagecontrol1.activepage.components[grd_idx] tmycomp)   exporttoexcel(export_dir+(pagecontrol1.activepage.components[grd_idx] tmycomp).name, (pagecontrol1.activepage.components[grd_idx] tmycomp),     true, true, true, 'xlsx');    end;  end; 

i use delphi xe5, 64bit project

update: noticed placing break points on line after showmessage has x icon invalid break point instead of little red icon valid break point traced beginning of procedure , can confirm starting line begin for loop not executed.

exporttoexcel built in procedure exporting data excel.

it quite possible pagecontrol1.activepage.componentcount=0 , code inside of cycle never executed.

p.s. if debugger not trying go first line of cycle, have optimizations switched on. check project properties "compiling/code generation" (and make sure use build configuration "debug").


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -