Hello,
it's my first time in RB2012, i will start to convert all my applications from VB6 to RBasic.
I would like to Know how to call Func. and how to code it to be used in RB project: This function convert
Decimal deg. to DMS,
Example X=25.51--> 25° 30' 36"
Public Function DecDms(x As Double, xd As Double, xm As Double, xs As Double) As string
Dim s As String
Dim sn As Integer, xp As Double, a As Double
sn = Sgn(x): xp = Abs(x): xd = Int(xp)
a = (xp - xd) * 60: xm = Int(a)
xs = Int((a - xm) * 600 + 0.5) / 10
s = "+"
If sn = -1 Then s = "-"
If xs = 60 Then xs = 0: xm = xm + 1: xs = Int(xs): xm = Int(xm)
If xm = 60 Then xm = 0: xd = xd + 1: xm = Int(xm): xd = Int(xd)
If s = "-" Then xd = xd * -1
End Function
Regards