delphi - if else statement not executing right -


i have funny behaviour of if else statement. @ start memo empty , attempted deletion triggers message. if write in memo , try delete, again right message comes up. then, after last deletion (memo empty) if click once again delete second message , not first (nothing delete. messing if else statements ?? right way here ?

procedure tform1.advglowbutton2click(sender: tobject); begin    if advmemo1.isempty       showmessage('nothing delete !')    else      begin      if messagedlg('delete everything?',                      mtconfirmation, [mbyes, mbno], 0) = mryes begin        advmemo1.lines.clear;        advmemo1.lines.savetofile(extractfilepath(application.exename)+ '\memo.txt');      end;    end; end; 

there nothing wrong code showed, isempty must returning false after last delete instead of returning true, suggests either 1) not deleted thought, or 2) isempty buggy.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -