List Index Out Of Bounds

Trying this script I get:
20-3-2014 16:22:41 Error Runtime error “List index out of bounds (17072129)” in notification script D:\mAirList\Scripts\Player_EOF_Clear.mls, handling message: PLAYERCONTROL_STOP 6D3BFB1518533F6E 0 0000 0000 19,781 ?

[code]procedure OnPlayerStop;

var
sl: TstringList;

begin
sl := TStringList.Create;
try
sl.Add(‘0’)
try
sl.SaveToFile(‘D:\mAirList\LPT\DF_5.txt’);
except
sleep(650);
sl.SaveToFile(‘D:\mAirList\LPT\DF_5.txt’);

     end;

  finally
     sl.Free;
      end;

	end;

begin
end.
[/code]

Any idea?

Regards,
Ferry

Hi Ferry,

you have to add some parameters to the procedure OnPlayerStop.
It is similar like this. Torben gave me the hint.

https://www.mairlist.com/forum/index.php/topic,7095.0.html

try this:

OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer)

or this:

OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer; Item: IPlaylistItem

I tried both “with ); at the end”
So:

procedure OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer; Item: IPlaylistItem);

and

procedure OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer);

Still same error.

and maybe a duration parameter. try maybe this?

procedure OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer; Item: IPlaylistItem; Duration: int64);

You are my hero 8)
That did the trick, thanks!

Ferry