Subject Re: [IBO] ANN: TIB_SynMemo ready for download
Author Frank Ingermann
Hi Claudio,

(sorry for also off-topic... i didn't put an OT: in the subject, though, since
this always seems to start a new thread - yahauagroops again...)

"Claudio Valderrama C." wrote:
> Sorry for jumping off-topic, but I need to ask something: is SynEdit a
> reliable highlighting editor? The reason I ask is that I understood that
> "IBConsolation" was using SynEdit, too and short after I used some IB syntax
> that included a quoted field with an embedded quote, the IBConsole editor
> puked (okay, not very polited word) and I observed the following:
> expcted colors in text before problem
> conflicting identifier, ex: "a quote "" inside"
> all the rest of the script in blue
> If you put a space between the two inner quotes, the editor is happy but IB
> will complain, because here "" is a scape sequence, you change the meaning
> if you put such a blank in the middle.

after some testing it appears you have found a bug in the TSynSQLSyn
Highlighter. You can easily fix it with the following modification:

in SynHighlighterSQL.Pas: ( the //@fi stuff )

procedure TSynSQLSyn.StringProc;
fTokenID := tkString;
while not (fLine[Run] in [#0, #10, #13]) do begin
case fLine[Run] of
'\': if fLine[Run + 1] = #34 then

#34: if fLine[Run + 1] <> #34 then
//@fi mod start
//@fi end;
else //@fi next char *is* a "
Inc(Run); //@fi skip second " (this was missing)
//@fi mod end
end; least this way it displays

SELECT "there's lots of """"""double"""""" quotes in here" FROM TTEST

correctly :) i only hope i didn't break other sql string implementations with
this, as the same highlighter is also for oracle, sqlserver etc. ( but then
again i personally don't care, Firebird rules! ;-) however, to make sure
i'll post it to the synedit-devel list so someone using oracle can check it.

btw. did you take a look at TIB_SynMemo ? (or anyone else?)
(or maybe i'm the only one to store sql statements in text blobs ??)

anyway - thanks & regards,

(and i hope you have better weather over in Brasil for Easter -
here in Germany it'll be snowing !)