I have a big problem with GPS capturing.
I capture GPS well and good and stores the values such that they cant change.
My problem is that when GPS fails, nothing is stored and then I cant proceed unless I I put gibberish.
if I go back to the modify/verify mode and GPS is not captured, I would like at that point that the GPS is rerun in that mode and captures GPS when available.
My code is as below
Code: Select all
PROC GPS_LATITUDE
preproc
if demode()=add then
gps(open);
if gps(read,60,10,"Reading GPS, Please wait...") = 1 then //read up to 60 seconds. if successful...
//execsystem(maketext("gps:%f,%f", gps(latitude),gps(longitude)));
if accept(maketext("Save this location? %f, %f",gps(latitude),gps(longitude)),"Yes","No") = 1 then //if yes
GPS_LATITUDE = gps(latitude);
GPS_LONGITUDE = gps(longitude);
endif;
elseif demode()=add then
errmsg("Gps location failed, Please try again");
GPS_LATITUDE = notappl;
GPS_LONGITUDE = notappl;
endif;
elseif demode()=(modify or verify) and (visualvalue($)=notappl or missing or -2) and (visualvalue(GPS_LONGITUDE)= notappl or missing or 1) then
gps(open);
if gps(read,60,10,"Reading GPS, Please wait...") = 1 then //read up to 60 seconds. if successful...
//execsystem(maketext("gps:%f,%f", gps(latitude),gps(longitude)));
if accept(maketext("Save this location? %f, %f",gps(latitude),gps(longitude)),"Yes","No") = 1 then //if yes
GPS_LATITUDE = gps(latitude);
GPS_LONGITUDE = gps(longitude);
endif;
else
errmsg("Gps location failed, Please try again");
gps(close);
endif;
endif;