New topic: 

Function in RB

<http://forums.realsoftware.com/viewtopic.php?t=46977>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        Djamel          Post subject: Function in RBPosted: Sun Feb 17, 
2013 6:07 am                                 
Joined: Fri Feb 15, 2013 6:07 am
Posts: 5
Location: Oran, Algeria                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   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to