Solved

Syntax errror in procedure

Posted on 2009-07-16
6
180 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 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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