Stephan Eickschen wrote:
writeln('Suche PAT'); {PAT finden} reset(dat4,kbd3+'/'+name1+'.E00'); suchstr:=name1+'.PAT'; ls:=length(suchstr); writeln('suchstr = ', suchstr, ' ls = ',ls); repeat readln(dat4,zeile2); writeln(zeile2); repeat if length(zeile2)<ls then readln(dat4,zeile2); writeln(zeile2); until (length(zeile2)>(ls-1)); until (substr(zeile2,1,ls)=suchstr); writeln(suchstr, ' gefunden'); readstr(trim(substr(zeile2,36,3)),anzparama); readstr(trim(substr(zeile2,44,3)),ldsa); readstr(trim(substr(zeile2,48,9)),anzdsa); writeln(suchstr, ' gefunden, anzparama = ', anzparama, ', ldsa = ', ldsa, ', anzdsa = ', anzdsa, ' ... ');
This might be a case of a known GPC problem that causes a stack overflow if the loop runs very often. If it's that, than the crash should occur sooner or later depending on the stack limit set.
A work-around in this case could be to assign the loop condition (substr(zeile2,1,ls)=suchstr) to a Boolean variable and test this in the `until'.
Frank