June 26, 200223 yr Can someone show how to read latitude at offset 0560 and 0564 as an example. I am writting in Visual Basic6.0 and i get an overflow when doing the (65536*65536)Heres part of my codeDim readlat1 As LongDim readlat2 As LongDim lat1 As LongDim lat2 As LongDim ActlLat as long If FSUIPC_Read(&H564, 8, VarPtr(readlat1), dwResult) Then If FSUIPC_Process(dwResult) Then lat1 = readlat1 *90/10001750 End If End If If FSUIPC_Read(&H560, 8, VarPtr(readlat2), dwResult) Then If FSUIPC_Process(dwResult) Then ActlLat= lat1 * 90 / 10001750) + ((lat2 * 90 / 10001750) / (6553 * 6553)) End If End IfThanksDoug
June 26, 200223 yr Ok, first recommendation is to split up the equation and simplify it. Here's how I'd try to write it:const LAT_TEMP = 4294180900 '(65530 * 65530)lngTemp1 = ((lat1 * 90) / 10001750)lngTemp2 = ((lat2 * 90) / 10001750)lngTemp3 = lngTemp1 + lngTemp2lngActlLat = lngTemp3 / LAT_TEMPI haven't tested this code, so it may or may not work. See what the value is at each step when you run the code.
Create an account or sign in to comment