Page 1 of 1

GPS

Posted: September 19th, 2016, 10:27 am
by hamouda1987
Hello Good people

i am using this code for GPS

if gps(read, 60, 10) then // Read up to 60 seconds, try for 10m accuracy
errmsg("Latitude is %f, longitude is %f",gps(latitude),gps(longitude));
else
errmsg("GPS signal could not be acquired");
endif;


when i want to consult or modify a record the latitude and longitude change position and i don't want to have that..

how can i do to resolve that

thanks a lot

Kind regards

Re: GPS

Posted: September 19th, 2016, 2:33 pm
by jfigueroa
Hi hamouda1987,

you can use the demode() function.
Some kind like:

Code: Select all

If demode() = 1 then
	if gps(read, 60, 10) then // Read up to 60 seconds, try for 10m accuracy
 		errmsg("Latitude is %f, longitude is %f",gps(latitude),gps(longitude));
 		LAT = gps(latitude);
		LON = gps(longitude);
	else
 		errmsg("GPS signal could not be acquired");
	endif;
endif;
That way you will only get the GPS position when adding a record, not in verify or modify mode.

If you don“t want to loose those values, it will be good if you store them on dictionary variables.
For ex:
LAT = gps(latitude);
LON = gps(longitude);

Regards.

Re: GPS

Posted: September 19th, 2016, 2:54 pm
by hamouda1987
thank you So much M.jfigueroa