Bracket Not Found
Original Reporter info from Mantis: jzs
-
Reporter name: JZS
Original Reporter info from Mantis: jzs
- Reporter name: JZS
Description:
Opening parenthesis within constant string enclosed in single quotations, such as: ('Create Temporary Table eSalesReturnsTemp -->(<--')
,is interpreted as unterminated bracket while toggling between the Form and the Code Editor by double clicking on a component (happened while double clicking a button to generate OnClick event), then a message saying "... Unable to show Method ..." appears.
It does not hinder the Compile or Run, but it keeps telling that an error is to be fixed, and highlight the line that contains the string, which includes unterminated parenthesis. The clicked button will not show it's code, nor viewing the method via the Object Inspector, unless scrolling up/down.
The very efficient way to make it disappear is to delete the opening bracket.
('Create Temporary Table eSalesReturnsTemp ')
It goes away right after removing that bracket and then accessing the event and then putting the bracket back in place.
But some times, I do not know how, the error disappears after few tries, without removing the bracket, and it does not happen again for a while, until revisiting that Unit again for some modifications.
Steps to reproduce:
I have noticed this behavior while adding SQL Queries in a procedure.
Originally the project has been converted from Delphi.
And upon working with the other units, in this same project, this issue never arose, nor creating a new project with the same procedure succeed to reproduce it. But while working in this particular project, and this very Unit, if I just toggle between the Form and the Unit nothing happens. But when starting editing an existing procedure or creating a new event (new button OnClick event) the compiler goes to the line that has opening bracket within string constant.
Strangely it misses other opening brackets within other string constants before this particular line, which are located in the same procedure.
procedure QryPrepare;
begin
// some other code
with TSQLQuery.Create(nil) do
begin
try
Close;
DataBase:=DataModule1.MySQL55Connection1;
SQL.Clear;
SQL.Add('Drop Table If Exists eSalesTemp;');
ExecSQL;
Close;
SQL.Clear;
SQL.Add('Create Temporary Table eSalesTemp (');
SQL.Add('svtID MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,');
SQL.Add('svt1 VARCHAR(74),');
SQL.Add('svt2 VARCHAR(74),');
SQL.Add('svt3 Int(11),');
SQL.Add('svt4 VARCHAR(74),');
SQL.Add('svt5 VARCHAR(74),');
SQL.Add('svt6 Int(11),');
SQL.Add('svt7 Int(11),');
SQL.Add('svt8 decimal(50,4),');
SQL.Add('svt9 decimal(50,4),');
SQL.Add('svt10 decimal(50,4),');
SQL.Add('svt11 decimal(50,4));');
ExecSQL;
Close;
SQL.Clear;
SQL.Add('Drop Table If Exists eSalesReturnsTemp;');
ExecSQL;
Close;
SQL.Clear;
SQL.Add('Create Temporary Table eSalesReturnsTemp (');
SQL.Add('srID MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,');
SQL.Add('sr1 VARCHAR(74),');
SQL.Add('sr2 VARCHAR(74),');
SQL.Add('sr3 Int(11),');
SQL.Add('sr4 VARCHAR(74),');
SQL.Add('sr5 VARCHAR(74),');
SQL.Add('sr6 Int(11),');
SQL.Add('sr7 Int(11),');
SQL.Add('sr8 VARCHAR(43),');
SQL.Add('sr9 Int(11),');
SQL.Add('sr10 Int(11),');
SQL.Add('sr11 decimal(50,4),');
SQL.Add('sr12 decimal(50,4),');
SQL.Add('sr13 decimal(50,4));');
ExecSQL;
finally
Close;
Free;
end;
end;
// complete some other code
end;
PS: this issue does not appear when compiling, it appears only when double clicking a button, for instance, to locate/create its event.
Another PS: I have changed the original column names with digits, but kept all the columns definitions.
Mantis conversion info:
- Mantis ID: 25767
- Version: 1.2.0RC2
- Monitored by: » jzs (JZS)