Цитата:
Сообщение от Lynx
А писать в файл как?
|
Посмотри скрипт на движение by Alexsl. Вот выдержки
delphi Код:
//***************************************************************
function GetValue(ValName: string): string;
begin
result:=RecordPath.Values[ValName];
end;
//......................................
//***************************************************************
procedure SetValue(ValName: string; Value: string);
begin
RecordPath.Values[ValName]:=Value;
end;
//......................................
//***************************************************************
procedure StartRecord;
begin
if SavePathEnabled then exit;
if MoveToPathEnabled then
begin
SendMsg2('Во время следования по маршруту запись не возможна');
msg.Lines.Add('Во время следования по маршруту запись не возможна');
exit;
end;
RecordPath.Clear;
PointsCount:=0;
SendMsg2('Начата запись маршрута');
msg.Lines.Add('Начата запись маршрута');
SavePathEnabled:=True
end;
//......................................
//***************************************************************
procedure StopRecord;
begin
if not SavePathEnabled then exit;
//записываем
RecordPath.SaveToFile(GetRecordFileName);
SendMsg2('Запись маршрута завершена');
msg.Lines.Add('Запись маршрута завершена');
SavePathEnabled:=False;
end;
//......................................
//***************************************************************
function GetRecordFileName: string;
begin
result:=RecordFilesPath+RecordPathFileName+RecordFileExt;
end;
//......................................
//***************************************************************
procedure ParseMoveClient;
var
i,x,y,z: integer; s: string;
begin
if not SavePathEnabled then exit;
i:=2;
x:=readd(i);
y:=readd(i);
z:=readd(i);
inc(PointsCount);
s:='|'+inttostr(x)+'|'+inttostr(y)+'|'+inttostr(z)+'|';
RecordPath.Add(s);
SendMsg2('добавлен чекпоинт № '+inttostr(PointsCount));
msg.Lines.Add('добавлен чекпоинт № '+inttostr(PointsCount));
end;
//......................................