Hello Folks
Would you could you be kind enough, to help this Mann that does not know enough???
I have been trying to implement this function. (Obtaining direction from course heading).
This function returns a string direction such as "north," "east southeast," etc from a heading between 0 and 360 degrees.
Sub getDirection(COG)
Dim direction
if COG >= 0 And COG <= 11.25 Then direction = "north"
if COG > 348.75 and COG <= 360 Then direction = "north"
if COG > 11.25 and COG <= 33.75 Then direction = "north northeast"
if COG > 33.75 And COG <= 56.25 Then direction = "northeast"
if COG > 56.25 And COG <= 78.75 Then direction = "east northeast"
if COG > 78.75 And COG <= 101.25 Then direction = "east"
if COG > 101.25 And COG <= 123.75 Then direction = "east southeast"
if COG > 123.75 And COG <= 146.25 Then direction = "southeast"
if COG > 146.25 And COG <= 168.75 Then direction = "south southeast"
if COG > 168.75 And COG <= 191.25 Then direction = "south"
if COG > 191.25 And COG <= 213.75 Then direction = "south southwest"
if COG > 213.75 And COG <= 236.25 Then direction = "southwest"
if COG > 236.25 And COG <= 258.75 Then direction = "west southwest"
if COG > 258.75 And COG <= 281.25 Then direction = "west"
if COG > 281.25 And COG <= 303.75 Then direction = "west northwest"
if COG > 303.75 And COG <= 326.25 Then direction = "northwest"
if COG > 326.25 And COG <= 348.75 Then direction = "north northwest"
return direction
End Sub
:BangHead:I know we can use this with the GPS library to determine direction. Yust cant figure it out. How can i bind Sub getDirection(COG) with lblDirection?
I want to use a Label(lblDirection)to show the Direction, on the Form.
The App is running but..
I added the source code into the main Module.
Question? What am I missing and or forgetting here, because i can not get this to fire up.
Thank you for the Effort to help!!!
WmC
PC: Laptop CoreDUo, Windows XP SP2 E
PPC:hp5550"ARM"/Windows CE 4.2
Bayern, Germany