Pat Heuvel 1 Posted November 24 (edited) Gday, I have a multiline string (or two) in my code to programatically add functions to a PostgreSQL database. They work well! However, one of them causes a problem when trying to use Ctrl-Shift-C to start a new function: I've traced this to one particular multiline string: CSqlDebugMsgFunction = ''''' -- fdebugmsg -- send debug message as notice to database log -- create or replace function fdebugmsg(amsg varchar) returns void as $fmsg$ begin raise notice '%', amsg; end; $fmsg$ language plpgsql; '''''; (of course, the "const" keyword appears a couple of declarations above this one). The clue to the problem is a small red arrow at the end of the "raise notice..." line. If I change "raise" to, for example, "xraise", the little red arrow goes away and Ctrl-Shift-C works as it should. So clearly, Delphi is parsing this line when i think it shouldn't. Can anybody please offer a suggestion as to how to fix this, or should I report it as a bug? Regards to all, Pat Heuvel Edited November 24 by Pat Heuvel Fix misspelling Share this post Link to post
corneliusdavid 214 Posted November 25 I tried this in D 12.2 and saw this just once the first time I inserted the code and tried to double-click a test button to create its OnClick event but then I made a couple of changes to the string, saved, then tried it again, and it worked. Sometimes the parsing needs to be jiggled a little, like take a couple of the quote marks off the beginning and end of the string constant, then try it, then put them back on. After that first stumble, it's working find for me now--and I can't get it to break again. Share this post Link to post
Pat Heuvel 1 Posted November 25 Thanks David. I tried the quotes thing, sadly to no effect. It's easy to see when the problem is gone, because the little red arrow at the right end of the line disappears! This is really an annoyance issue, because I can't use Ctrl-Shift-C; otherwise, the code compiles and functions perfectly! A workaround is to comment out that line (!), add whatever procs I need, then uncomment the line. Even that is funny, because the comment marker becomes a piece of the text, as expected. My brain hurts. Share this post Link to post