To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Display Modes
Old Oct 1st, 2005, 05:26 PM   #1
Edward233
New Member
 
Join Date: Oct 05
Posts: 15
Edward233 is an unknown quantity at this point (<10)
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
  76.  

im just new to this site sorry for not reading before i posted!!!
I now it looks messey but any help is appreciated
Ed
Edward233 is offline   Reply With Quote
Old Oct 1st, 2005, 05:33 PM   #2
RhinoBull
PowerPoster
 
RhinoBull's Avatar
 
Join Date: Mar 04
Location: New Amsterdam
Posts: 21,118
RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)RhinoBull is a name known to all (1000+)
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...
RhinoBull is offline   Reply With Quote
Old Oct 1st, 2005, 05:37 PM   #3
dglienna
Banned
 
dglienna's Avatar
 
Join Date: Jun 04
Location: Center of it all
Posts: 17,901
dglienna is a glorious beacon of light (400+)dglienna is a glorious beacon of light (400+)dglienna is a glorious beacon of light (400+)dglienna is a glorious beacon of light (400+)dglienna is a glorious beacon of light (400+)dglienna is a glorious beacon of light (400+)
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.
dglienna is offline   Reply With Quote
Old Oct 3rd, 2005, 01:46 AM   #4
penagate
Super Moderator
 
Join Date: Jan 05
Location: Sunny Adelaide
Posts: 12,738
penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)
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
penagate is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:09 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.