Registriert seit: 18. Apr 2004
Ort: Linz
2.044 Beiträge
Turbo Delphi für Win32
|
Zugriffsverletzung ??? Ich kappiers nicht!
13. Mai 2004, 19:57
Hallo!
Also ich hab grad ein totales Blackout!
Ich kappiers nicht. Wiso tritt denn da eine Zugriffsverletzung auf?
Delphi-Quellcode:
unit Unit2;
interface
uses SysUtils, AgentObjects_TLB;
const
LMax = 2;
type
TCommandAction = (ccTrue, ccFalse, ccNoCommand);
function Inizialize( const Command: String; AgentItem: IAgentCtlCharacterEx): TCommandAction;
function ActCommand(Commands: Array of String; AgentItem: IAgentCtlCharacterEx): TCommandAction;
implementation
function Inizialize( const Command: String; AgentItem: IAgentCtlCharacterEx): TCommandAction;
var
Commands: Array[1..LMax] of String;
i, j: Integer;
begin
j := 0;
if Length(Command) > 0 then
begin
for i := 0 to Length(Command) - 1 do
if Command[i] <> ' ' then
Commands[j] := Commands[j] + Command[i]
else
if j < Lmax then
inc(j)
else
break;
Result := ActCommand(Commands, AgentItem);
end
else
Result := ccFalse;
end;
function ActCommand(Commands: Array of String; AgentItem: IAgentCtlCharacterEx): TCommandAction;
begin
if Commands[1][1] = ' :' then //Hier tritt sie auf.... hm....
begin
result := ccTrue;
end
else
result := ccNoCommand;
end;
end.
Faux Manuel Wer weiß, dass er nichts weiß, weiß mehr, als der der nicht weiß, dass er nichts weiß.
|