Page 2 of 2

Re: GPS STORAGE IN ENTRY, MODIFY AND VERIFY MODES

Posted: January 18th, 2019, 2:47 am
by khurshid.arshad
Another example, if you can work on it.

Code: Select all

PROC L_LATITUDE_N

Onfocus

	if 	getos() = 20 then //only on Tablet
		if visualvalue(L_LATITUDE_N) <> notappl and visualvalue(L_LOGITUDE_E)<> notappl  then
			if accept ("Do you want update GPS Coordinates?",	"Yes, Update GPS Coordinates",
				"No, Keep Previous Coordinates")=1 then
				gps(open);

				If gps (read, 60) then
					errmsg ("Updted GPS: Latitude is %f, logitude is %f", gps(latitude), gps(longitude));

					L_LATITUDE_N =gps (latitude);
					L_LOGITUDE_E=gps (longitude);

					set attributes (L_LATITUDE_N) protect;
					set attributes (L_LOGITUDE_E) protect;

					Advance to L_LOGITUDE_E;

				else//Keep previous GPS
					errmsg("Message 3: GPS signal could not be acquired");
					set attributes (L_LATITUDE_N) protect;
					set attributes (L_LOGITUDE_E) protect;
					Advance to L_LOGITUDE_E;

				endif;
			else//Keep previous GPS

				set attributes (L_LATITUDE_N) protect;
				set attributes (L_LOGITUDE_E) protect;

				Advance to L_LOGITUDE_E;

			endif;
		else
			gpsi=1;
			do  while  gpsi<=2 and visualvalue(L_LATITUDE_N)=notappl and visualvalue(L_LOGITUDE_E)=notappl ;
				//	errmsg ("The n is %d", gpsi);
						gps(open);

				If gps (read, 60) then
					errmsg ("Latitude is %f, logitude is %f", gps(latitude), gps(longitude));
					L_LATITUDE_N =gps (latitude);
					L_LOGITUDE_E=gps (longitude);

					set attributes (L_LATITUDE_N) protect;
					set attributes (L_LOGITUDE_E) protect;
					Advance to L_LOGITUDE_E;
				elseif gpsi=1 then
					//			errmsg ("the gps %d", gpsi);
											set errmsg (operator);
											errmsg("Message 7: GPS signal could not be acquired in First Attempt.\n\nGoing to Attempt #%d", gpsi);
											set errmsg (default);

									//				errmsg("Message 6: GPS signal could not be acquired");
									//				move to L_Enu_Comm;
				endif;
				gpsi=gpsi+1;
			enddo;
			if gpsi=3 then
				errmsg("Message 6: GPS signal could not be acquired");
				L_LATITUDE_N =111.1111111;
				L_LOGITUDE_E=111.1111111;
					set attributes (L_LATITUDE_N) protect;
					set attributes (L_LOGITUDE_E) protect;
					Advance to L_LOGITUDE_E;
			else
			endif;
		endif;
	else
	endif;
Best.
a.