Заменил переменную Sep на SepPos, добавил StrUtils и всё заработало! Спасибо!
Код:
function UnCom(Source,Sep:string): String; //+StrUtils
var
SepPos: integer;
begin
SepPos:=AnsiPos(Sep,Source);
if SepPos=0
then result:=Trim(Source)
else result:=Trim(AnsiLeftStr(Source, SepPos));
end;