?
Solved

Syntax errror in procedure

Posted on 2009-07-16
6
Medium Priority
?
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 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 1000 total points
ID: 24871464
InputQuery('New Item', 'New Item Name:', aText)   << Missing Semi Colon
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 143

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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