<div dir="ltr">I have a unit in which I'm parsing a large text file.<div><br></div><div style>I have around 50 (or more!) IF statements as below:</div><div style><br></div><div style><div>if Pos(' Center Point',OdReadstrings.Strings[i])>0 then</div>
<div> val+=',PT='+getParam(PChar(OdReadstrings.Strings[i]))</div><div>else if Pos(' Custom Scale',OdReadstrings.Strings[i])>0 then</div><div> val+=',SC='+getParam(PChar(OdReadstrings.Strings[i]))</div>
<div>else if Pos(' Check',OdReadstrings.Strings[i])=1 then</div><div> val+=',FZ='+getParam(PChar(OdReadstrings.Strings[i]))</div><div>else if Pos(' Min Extents',OdReadstrings.Strings[i])>0 then</div>
<div> val+=',MN='+getParam(PChar(OdReadstrings.Strings[i]))</div><div>else if Pos(' Max Extents',OdReadstrings.Strings[i])>0 then etc, etc.</div><div><br></div><div style>No error is generated from this code, per se, but on closing the programme there is an External SIGSEVV genterated in lclrescache.pas at line 186.</div>
<div style><br></div><div style>The offending line:</div><div style><br></div><div style>Cache.RemoveItem(Self);<br></div><div style><br></div><div style>Can anyone see what's going on here? Alternatively, is there a better way of parsing a large text file for phrases?</div>
<div style><br></div><div style>Many thanks,</div><div style><br></div><div style>Dave Coventry</div></div></div>