Insert Dummy..

My swap (for versioning) script is going well but I have a question, it maybe because I couldn’t find it in the help file…

If a swap fails , I plan to replace it with a DUMMY line, but can’t seem to find a way to do that. I can find IPlaylistDummyItem but if I add that

[code]
var
i, iItemCount : integer;
szSwap: string;
currentItem: IPlaylistItem;
isAttribute : IStrings;
Dummy : IDummyPlaylistItem;

//More stuff as well

if FileExists(szSwap) then
begin
CurrentPlaylist.Delete(i);
iItemCount := CurrentPlaylist.GetCount;
CurrentPlaylist.InsertFile(i,szSwap);
end else
begin
CurrentPlaylist.Insert(i, Dummy);
end;[/code]

Dummy is set to IDummyPlaylistItem in the var region!

Basically, if file doesn’t exist and I try and add the dummy, it manages to blow up mAirlist rather well. I’ve tried IDummyPlaylistIte.create and New and also some of the other objects as well.

Any guidance appreciated.

Thanks, Richard

There’s something you need to do with ‘factory’ to create the item but I forget the exact method right now (in a hurry!).

BFN
CAD

Correct - look at the IFactory interface (accessible throught the “Factory” function). There are methods for creating the most common playlist item objects (and other objects).