Posts: 72
Threads: 11
Joined: Feb 2005
Hi!
This code generate error
commentbug1.bas(4) : error 40: Expected 'END SUB' or 'END FUNCTION', found: 'Ñ'
Code:
SUB bas2Html (inFile AS STRING)
'qq Ñ
end sub
http://www.wildgardenseed.com/RQDP/commentbug1.zip
Posts: 77
Threads: 27
Joined: Dec 2004
I think it's because FBC isn't Unicode-compatible, and that Russian character (Ñ) is only in Unicode fonts, if I'm correct. In plain ASCII, that Unicode character would appear as some two-byte string, I guess, one of which is that symbol you received as an error.
Am I somewhat close?
Posts: 72
Threads: 11
Joined: Feb 2005
Quote:I think it's because FBC isn't Unicode-compatible, and that Russian character (Ñ) is only in Unicode fonts, if I'm correct. In plain ASCII, that Unicode character would appear as some two-byte string, I guess, one of which is that symbol you received as an error.
Am I somewhat close?
No, (Ñ) is ASCII - char$(255) (hex FF)
well
print chr$(255) 'works fine
print "ÑÑÑÑÑ" 'works fine
'ÑÑÑÑÑ' - cause error
chr255bug.bas(2) : error 3: Expected End-of-Line, found: '_'
Posts: 336
Threads: 4
Joined: Nov 2004
most likely a glitch in one of the parsers or tokenizer
Posts: 242
Threads: 29
Joined: Dec 2004
There are several keywords that have ' at the beginning:
'$DYNAMIC
'$INCLUDE
etc.
So the parser must continue to check the commented code, otherwise it could treat ' as end-of-line.
Also chr$(255) is treated as a special command for multikey processing:
chr$(255) + "X" ' user closed window
If you are trying to embed chr$(255) in your code, you are just asking for trouble, even if it comes after a comment.
ature has its way of warning a person away from danger: The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
Posts: 922
Threads: 15
Joined: Jun 2003
There was really a problem with char 255 when used in comments, i was using an integer (instead of an unsigned one) to load the current byte, meaning 255 became -1, and -1 is "seem" as invalid char by the lex module.. it was fixed, but you can't rebuild the compiler using the old versions, due a chicken-egg problem, you will have to wait for the next release, sorry..
Posts: 72
Threads: 11
Joined: Feb 2005
Quote:.. it was fixed, but you can't rebuild the compiler using the old versions, due a chicken-egg problem, you will have to wait for the next release, sorry..
Absolutely no problem!
It's for information only. If you already fix it - so much the better
Thanks.