Solved

Just a quick simple one - if/then/else syntax!

Posted on 2009-04-19
Medium Priority
785 Views
Below is my code, somehow managed to mess up the syntax but my tired eyes can't see where I've gone wrong!

Cheers!
procedure TFrmEPOS.BtnTransactionVoidClick(Sender: TObject);
var count: integer;
begin
if BtnEposTotal.Enabled = true then
for count := 0 to Strrow do
StrGridTransaction.Cells[1,Strrow]:='';
StrGridTransaction.Cells[0,Strrow]:='';
else
Strrow := Strrow +1;
for count := 0 to Strrow do
StrGridTransaction.Cells[1,Strrow]:='';
StrGridTransaction.Cells[0,Strrow]:='';
MmoTransactionTotal.Text:='';
BtnEposDelete.Enabled := true;
BtnEposQuantity.Enabled := true;
BtnEposTotal.Enabled := true;
end;

end.
0
Question by:TTRMW
1 Comment

LVL 12

Accepted Solution

Hypo earned 1000 total points
ID: 24182242
I guess is that it should be like this... :)

/Hypo
procedure TFrmEPOS.BtnTransactionVoidClick(Sender: TObject);
var count: integer;
begin
if BtnEposTotal.Enabled = true then begin
for count := 0 to Strrow do begin
StrGridTransaction.Cells[1,Strrow]:='';
StrGridTransaction.Cells[0,Strrow]:='';
end;
end else begin
Strrow := Strrow +1;
for count := 0 to Strrow do begin
StrGridTransaction.Cells[1,Strrow]:='';
StrGridTransaction.Cells[0,Strrow]:='';
end;
MmoTransactionTotal.Text:='';
BtnEposDelete.Enabled := true;
BtnEposQuantity.Enabled := true;
BtnEposTotal.Enabled := true;
end;
end;
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month15 days, 1 hour left to enroll