Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

clsSunrise

Posted on 2003-11-12
2
Medium Priority
?
262 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
2 Comments
 
LVL 3

Accepted Solution

by:
monvelasquez earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

877 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