Solved

clsSunrise

Posted on 2003-11-12
2
250 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 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

803 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