Results 1 to 4 of 4

Thread: [RESOLVED] VB6 code cleanup #2

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    15

    Resolved [RESOLVED] VB6 code cleanup #2

    Hi all

    I have this project that im doing and some of the code is from another real earlyer version and im trying to clean it up a bit or alot. Here is the code im working on.

    VB Code:
    1. Option Base 1
    2. Dim zflag As Integer
    3. Dim la As Integer 'latdir number
    4. Dim lo As Integer 'longdir number
    5. Dim elat As Double 'geocentric latitude (degrees)
    6. Dim elon As Double 'geocentric longitude (degrees)
    7. Dim iday As Integer 'day of ambient table
    8. Dim imonth As Integer 'month of ambient table
    9. Dim iyear As Integer 'year of ambient table
    10. Dim slat As Double 'sine of geocentric latitude
    11. Dim clat As Double 'cosine of geocentric latitude
    12. Dim dis As Double 'geocentric distance (kms)
    13. Dim wlon As Double 'western longitude (hours)
    14. Dim ajd As Double 'astronomical julian day of the month
    15. Dim aday As Double 'day of the year
    16. Dim gast As Double 'correction for nutation and aberration
    17. Dim jds As Double 'julian day for space
    18. Dim lha0s 'local hour angle of sun (degrees)
    19. Dim dhas As Double 'hour angle displacement of sun
    20. Dim sdelta As Double 'declination of first day (sun)
    21. Dim dsdec As Double 'dec. displacement of two days (sun)
    22. Dim pcmoon As Integer 'percentage illumination of the moon
    23. Dim lha0 As Double 'local hour angle of moon (degrees)
    24. Dim dha As Double 'hour angle displacement of moon
    25. Dim delta As Double 'declination of the first day (moon)
    26. Dim ddec As Double 'dec. displacement of two days (moon)
    27. Dim lha00 As Double 'initial value of lha0
    28. Dim dha0 As Double 'initial value of dha
    29. Dim delta0 As Double 'initial value of delta
    30. Dim ddec0 As Double 'initial value of ddecdim
    31. Dim id, im, iy As Long 'calender date from caldat
    32. Dim idow As Integer ' day of the week number
    33. Dim ut As Double
    34. Dim sset As Double 'sunset (hours)
    35. Dim srise As Double 'sunrise (hours)
    36. Dim mrise As Double 'moonrise (hours)
    37. Dim mset As Double 'moonset (hours)
    38. Dim az1 As Double 'solar azimuth as sunset (degrees)
    39. Dim az2 As Double 'solar azimuth as sunrise (degrees)
    40. Dim el1 As Double 'solar elevation
    41. Dim CTW(2) As Double ' civil twilight (eve,morn) (hours)
    42. Dim NTW(2) As Double ' nautical twilight (eve,morn) (hours)
    43. Dim ATW(2) As Double ' astronomical twilight (eve,morn) (hours)
    44. Dim TOTAL As Integer ' number of pieces of data
    45. Dim HR(50) As Integer ' array of hours
    46. Dim mn(50) As Integer ' array of minute
    47. Dim AZ(50) As Double ' array of lunar azimuths / half hour
    48. Dim ELEV(50) As Double ' array of lunar elevations / half-hour (degrees)
    49. Dim AZS(50) As Double ' array of solar azimuths / half hour
    50. Dim ELEVS(50) As Double ' array of solar elevations / half-hour (degrees)
    51. Dim WXFACT(50) As Integer ' WX forecast factors
    52. Dim ILLM(50) As Double ' modified illuminance
    53. Dim IRRM(50) As Double ' modified irradiance
    54. Dim range As Double
    55. Dim inputgood As Boolean 'dates and lat/long goodF
    56. 'for LIGHT
    57. Dim moonrise(31) As Double 'hours
    58. Dim moonset(31) As Double 'hours
    59. Dim sunrise(31) As Double 'hours
    60. Dim sunset(31) As Double 'hours
    61. Dim dlhrs(31) As Double 'total daylight hours (hours)
    62. Dim atw1(31) As Double 'evening astronomical twilight (hours)
    63. Dim ntw1(31) As Double 'evening nautical twilight (hours)
    64. Dim ctw1(31) As Double 'evening civil twilight (hours)
    65. Dim ctw2(31) As Double 'morning civil twilight (hours)
    66. Dim ntw2(31) As Double 'morning nautical twilight (hours)
    67. Dim atw2(31) As Double 'morning astronomical twilight (hours)
    68. Dim pcmoon2(31) As Integer 'percentage illumination of moon
    69. Dim idow2(31) As Integer 'day of the week
    70. Dim illum(50) As Double ' array of illum/half-hour
    71. Dim irrad(50) As Double ' array of irrad/half-hour uw/m2)
    72. '
    73. Public tLocationName As String 'Station Information Variables
    74. Public tStationID As String 'for info to be passed from
    75. Public tPoliticalID As String 'StationAddition form to frmMain

    im just new to this site sorry for not reading before i posted!!!
    I now it looks messey but any help is appreciated
    Ed

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 code cleanup #2

    What exactly would expect from "clean-up" ? Those are variable and/or array declarations and each of them is most likely to be used in your project somehow. If you really want to "clean-up" then you might need to revise your project completely and hopefully (for you) you'll find some logic to be redundant so you would egt rid of it wich may result in "deleting" some of your vars/arrays...

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: VB6 code cleanup #2

    If you download MZTools, it will tell you which variables are not used in your app, and which statements aren't called. It could be very useful to someone doing what you are doing. I use it all the time.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] VB6 code cleanup #2

    Instead of posting the same thread again, you can edit your post using the little Edit button at the bottom right corner

    http://www.vbforums.com/showthread.php?t=363410

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width