|
Post by Stefan on Feb 18, 2023 12:23:39 GMT -5
George,
This applies to v23045 and it affects the way comments are recognised and coloured, so I guess it might(!) also affect the new +/-COMMENT keywords recognition process.
I can illustrate this with an example, using my normal AUTO.AUTO file - ie. colorisation for <any>.AUTO files.
Pic-Error shows the incorrect colorisation for the COMMENT1 line. All the green text should be grey.
Pic-Correct shows the correct image. Note that the only change I made was to replace the capital 'C' in column 79 with a lower-case 'c' on line 000006.
You can produce the same error if you change the 'c' in column 47 or in column 69 to a capital 'C' on line 000006.
What's so 'special' about upper case 'C' that interferes with colorisation of line number 000006?
I attach my AUTO.AUTO file to save you some typing when testing.
|
|
|
Post by George on Feb 18, 2023 14:08:04 GMT -5
Stefan: OK, very weird.
Add a QUOTED nn `` (or any other weird character you like.
PowerBasic INSTR function, if given a null string to search for, will always return a 1. Guess what character is in col 1, and then think of that character as being a quote.
The new code to eliminate comments within quoted strings got caught on this. I'll make a correction to handle this 'just in case' condition.
How did you ever stumble on the uniqueness of the C character?
George
|
|
|
Post by Stefan on Feb 18, 2023 18:01:38 GMT -5
Haha, pure luck. I was amending the comment text after the ';' and noticed that occasionally it went wonky. So I started to add/delete letters until it misbehaved. For line 6 it happend to be a 'C' After posting this bug, I found that for other lines it was other characters, but you'd already found the cause by then.
I share you annoyance with INSTR, unsurprisingly ThinBasic is the same. I now habitually code something like "pos = IIF(match$="", 0, INSTR(main$,match$))" to avoid this particular pitfall. unless I'm certain that match$ cannot be "".
|
|
|
Post by George on Feb 18, 2023 21:18:06 GMT -5
Well, believe it or not, but thinBasic is written in PowerBasic, and a large number of thinBasic functions are simply wrappers for PowerBasic native functions. That's one reason the macro performance is so good. George
|
|