Peter Kiers
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.ImageI ndex = 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
[
Who can help me to solve the errors in this procedure:
procedure TForm1.FileBtnClick(Sender
var aText: string;
begin
aText := '';
if (TreeView1.Selected <> nil) and (TreeView1.Selected.ImageI
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
angelIII,
What are *you* doing over here? Are you trying to add a Delphi Zone notch to your genius belt? ;-)
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
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
ASKER