Empty string in Delphi / Windows combo box causes access exception -


i've got delphi 7.0 application throws memory access exception / message box every time writeln's empty string string list associated combo box:

csvstrlst := combobox1.items;  csvstrlst.clear; csvstrlst.add('');    //problem csvstrlst.add('a');   //no problem csvstrlst.add('');    //problem csvstrlst.add('b');   //no problem  //throws memory access messages (i think writeln writes line though) n := 1 csvstrlst.count begin     writeln(out_file,csvstrlst.strings[n-1]) end;  //throws memory access messages (writeln write comma text string though) writeln(out_file,csvstrlst.commatext); 

running on windows 7 or xp. application or in d7 ide. combobox empty string items causes same error if parent of form on changed.

has else ever seen or heard of problem? other information available @ all?

this known , solved bug described in qc:

tcombobox gives av when selecting empty item dropdown


although bug, should not reuse parts controls perform data tasks described in question.

you not save doing so, getting time unwanted sideeffects (controls repainted and/or fire events)

if want have tstringlist create instance.

csvstrlst := tstringlist.create; try    // csvstrlst.clear;   csvstrlst.add( '' );   csvstrlst.add( 'a' );   csvstrlst.add( '' );   csvstrlst.add( 'b' );    n := 0 csvstrlst.count - 1    begin     writeln( out_file, csvstrlst[n] )   end;    writeln( out_file, csvstrlst.commatext );    csvstrlst.free; end; 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -