?
Solved

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

Posted on 2009-04-19
1
Medium Priority
?
785 Views
Last Modified: 2013-11-23
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:='';
      BtnEposAdd.Enabled := true;
      BtnEposDelete.Enabled := true;
      BtnEposQuantity.Enabled := true;
      BtnEposTotal.Enabled := true;
end;
 
end.

Open in new window

0
Comment
Question by:TTRMW
1 Comment
 
LVL 12

Accepted Solution

by:
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:='';
    BtnEposAdd.Enabled := true;
    BtnEposDelete.Enabled := true;
    BtnEposQuantity.Enabled := true;
    BtnEposTotal.Enabled := true;
  end;
end;

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question