Solved

Syntax errror in procedure

Posted on 2009-07-16
6
175 Views
Last Modified: 2012-05-07
Hi,

Who can help me to solve the errors in this procedure:
procedure TForm1.FileBtnClick(Sender: TObject);
var aText: string;
begin
  aText := '';
  if (TreeView1.Selected <> nil) and (TreeView1.Selected.ImageIndex = 15) then
  begin
      InputQuery('New Item', 'New Item Name:', aText)
      if length (trim(aText)) = 0 then      <==========================
        repeat
          MessageBox(0, 'You must enter an item name.', 'Error', MB_OK + MB_ICONEXCLAMATION);
        until length(trim(aText)) > 0;
        end;
       if length(trim(aText)) > 0 then  AddItem(aText, 17, TreeView1.Selected);
     end;
  end else                   <==========================
    ShowMessage('Select a folder in the treeview first.');
end;

Errors:
[Pascal Error] Unit1.pas(249): E2066 Missing operator or semicolon
[Pascal Error] Unit1.pas(256): E2029 '.' expected but 'ELSE' found
[
0
Comment
Question by:peterkiers
  • 2
  • 2
  • 2
6 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 24871385
my delphi time is a bit old, but I would say the
end;

after the until is too much..
0
 
LVL 1

Author Comment

by:peterkiers
ID: 24871415
Still the same errors.
0
 
LVL 14

Assisted Solution

by:SteveBay
SteveBay earned 250 total points
ID: 24871464
InputQuery('New Item', 'New Item Name:', aText)   << Missing Semi Colon
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:peterkiers
ID: 24871476
Thanks.
0
 
LVL 14

Expert Comment

by:SteveBay
ID: 24871514
angelIII,
What are *you* doing over here? Are you trying to add a Delphi Zone notch to your genius belt? ;-)
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24871581
SteveBay,

let me explain:
§ I was declared once the nerdiest nerd of all times @ EE (at some EE conference)... looking at all questions of EE all the time ...
§ seriously, my programming started with Turbo Pascal and then Borland Delphi. despite the fact that it is thousands of years ago (at least), some principles are still the same, and even the same across the different languages

§ some concurrence might do good, no ? 8)


CU
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtualstringtree carsh after invalidate for while 5 86
PDF library for Delphi 2 104
Print Graphic and Text to Epson TM-T88v 12 171
Create a path if not exists 7 69
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now