Solved

clsSunrise

Posted on 2003-11-12
2
257 Views
Last Modified: 2011-09-20
There is a class called clsSunrise downloadable from freevbcode.com that contains the computations for sunrise, sunset, etc. I have been unable to write the code to access and use this class, can someone write a small aplication showing how to use this class and the functions contained in it?
0
Comment
Question by:ralphy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
monvelasquez earned 500 total points
ID: 9736983
here's some sample code

--[CODE]-----------------------------------------------------
Dim Sun As New clsSunrise

Sun.City = "Hong Kong, China"
Sun.DateDay = #11/14/2004#
Sun.CalculateSun

Debug.Print Sun.Sunrise
Debug.Print Sun.SolarNoon
Debug.Print Sun.Sunset

Set Sun = Nothing

--[/CODE]----------------------------------------------------

the list of cities are located in the class itself..
you can add more cities in the InitCities method using the AddCity method provided
you know the Latitude, Longitute, and time zone of the city you're adding..
0
 
LVL 22

Expert Comment

by:danaseaman
ID: 9737056
'Using a pre-defined city. Optionally you can individually set Latitude, Longitude, TimeZone , DaySavings, and DateDay
'Initiates as todays date but you can specify date with Property DateDay.
Option Explicit

Dim cSunrise As New clsSunrise

Private Sub Form_Load()
   Me.Show
   With cSunrise
      .City = "Boston, MA"
      .CalculateSun
      Debug.Print .Sunrise, .Sunset
   End With
   
End Sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question