Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

Syntax errror in procedure

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
[
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peter Kiers

ASKER

Still the same errors.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.
angelIII,
What are *you* doing over here? Are you trying to add a Delphi Zone notch to your genius belt? ;-)
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