为什么TStringList会抛出access violation 异常?
抛出access violation at address
procedure TForm1.Button1Click(Sender: TObject);
var
list: TStrings;
mychar: Pchar;
begin
list := TStringList.Create;
list.Delimiter := '^';
//这边进行任何对list,mychar的操作 怎么会导致下面抛出抛出access violation at address?
try
if (list<>nil) and (mychar<>nil) then list.DelimitedText := strPas(mychar);
except
on e : Exception do
begin
MessageBox(Handle, PChar('错误:' + e.Message), '错误信息', MB_ICONERROR);
Exit;
end;
end;
end;