I cannot find out why this happen. On windows I have a txt file from which I read first line with text '[směr:A->B]'
.
I thet my code with debugger. I use breakpoints so I see, that the result of AnsiPos(line, '[sm')
is 0. Why? I suppost to get 1. But I tried to search for AnsiPos(line, 'sm')
or just AnsiPos(line, 'm')
and still not positive result. Why? I tried Pos()
too. Should I use different function? What I missed?
readln(f,line);
if line[1]='[' then
begin;
if line[2]='s' then
if AnsiPos(line, '[sm') > 0 then
begin
if AnsiPos(line, 'B->A') > 0 then
smerTestu := 'B'
else
smerTestu := 'A';
end;
end;