Solved

Syntax errror in procedure

Posted on 2009-07-16
6
173 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

10 Experts available now in Live!

Get 1:1 Help Now