for some reason this random switch does not compile
var c: char; begin case c of #32..#33, #35..pred('\'), succ('\')..#255, #256..#65535: ...
The compiler says: "[DCC Error] poparser.pas (206): E2030 Duplicate shortcut"
I checked it, and SizeOf (c) is 2, Low (c) is 0, High (c) is 65535, which means the ranges should be in order. Then pred ('\') seems to be 91, and succ ('\') seems to be 93, which is also normal. I also commented on other cases, and the result is the same. So what's the problem here?
Here is the complete procedure:
function String2PO (s:string):string; // Converts a string to the syntax that is used in .po files var i: integer; c: char; escnext:boolean; begin Result := ''; escnext:=False; for i := 1 to length(s) do begin c := s[i]; case c of
I found out that if I changed the line to
#32..
(removal .. # 255, # 256 ..), then it compiles :)
Note: this is delphi 2009
duplicates case delphi
tomm760
source share