Ah, okay. In my case, it doesn't work if the set you specify is a constant or variable defined elsewhere.
e.g.
const Delimiters: array[0..5] of Char = [#9, #10, #12, #13, #26, #32];if C in Delimiters then...
If you do that, you get a compiler error about 'in' not being overloaded or some such.
Gareth aka. Kit
On Tue 05/03/19 06:36 , Michael Van Canneyt sent:
J. Gareth Moreton wrote 23 lines
At the risk of sounding stupid, but why would you want to add this if the compiler supports this out of the box ?
var
C : char;
begin
if ParamCount>0 then
c:=paramstr(1)[1]
else
c:=#0;
if c in ['a','b','c'] then
writeln('ok')
else
writeln('not ok')
end.Michael.
