1 (edited by manixs2013 2019-06-19 10:16:30)

Topic: relative path

Hello MVD!

I need a help on how to open a file on relative path not on the absolute path... then via button it will implement the syntax.... please:

My purpose is even on the USB you can load the "file.gpx".


SAMPLE:     Form1.Map1.LoadGPSRoute('d:\file.gpx', clRed, 2, True);

Thanks!

Re: relative path

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
  OpenDialog : TOpenDialog;
begin
   OpenDialog := TOpenDialog.Create(Form1);
   IF OpenDialog.execute then
   begin
      ShowMessage(OpenDialog.Filename);
   end;
   OpenDialog.Free;
end;

3 (edited by manixs2013 2019-06-19 13:13:44)

Re: relative path

How can i call this function to USB

frmRoute.MapRoute.LoadGPSRoute(' ', clRed, 2, True);

frmRoute.MapRoute.LoadGPSRoute('c:\xxxGPXfiles\quiraing.gpx', clRed, 2, True);

4 (edited by sibprogsistem 2019-06-19 13:55:38)

Re: relative path

manixs2013 wrote:

How can i call this function to USB

frmRoute.MapRoute.LoadGPSRoute(' ', clRed, 2, True);

frmRoute.MapRoute.LoadGPSRoute('c:\xxxGPXfiles\quiraing.gpx', clRed, 2, True);

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
  OpenDialog : TOpenDialog;
begin
   OpenDialog := TOpenDialog.Create(Form1);
   IF OpenDialog.execute then
   begin
      Form1.Map1.LoadGPSRoute(OpenDialog.Filename, clRed, 2, True);
   end;
   OpenDialog.Free;
end;

Re: relative path

WOW... Thanks sibprogsistem!