RDOWeatherForecastCollection object

 

RDOWeatherForecastCollection represents a collection of the RDOWeatherForecast objects returned by thee RDOWeatherConditions.Forecast property.

 

Returned by:

RDOWeatherConditions.Forecast

 

See also: RDOWeatherServices, RDOWeatherLocations, RDOWeatherLocation, RDOWeatherConditions, RDOWeatherForecast

 

The example below retrieves the weather condition for the current user.

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

set CurrentUser = Session.CurrentUser

strCity = CurrentUser.City

if strCity <> "" Then 'we need to have at least the city for the weather

  strState = CurrentUser.StateOrProvince

  strCountry = CurrentUser.Country

  strLocation = strCity

  if strState <> "" Then strLocation = strLocation & ", " & strState

  if strCountry <> "" Then strLocation = strLocation & ", " & strCountry

  set WeatherServices = Session.WeatherServices

  set locations = WeatherServices.ResolveLocation(strLocation)

  if locations.Count = 0 Then

    MsgBox "Unable to resolve location " & strLocation

  Else

    'todo: check if there is more than one match

    set objLocation = locations(1)

    'if the location is not yet added to list of locations in the current mailbox,

    'add it (but we don't have to do that)

    if (WeatherServices.Locations.Item(objLocation.Code) Is Nothing) Then

      WeatherServices.Locations.Add(objLocation)

      WeatherServices.Save

    End If

    'display the current weather for the mailbox owner

    set CurrentConditions = objLocation.GetCurrentConditions

    strCurrentWeather = "Weather for " & CurrentConditions.LocationName & vbCrLf & _

                        "Temperature: " & CurrentConditions.Temperature & vbCrLf & _

                        "Wind: " & CurrentConditions.WindDisplay & vbCrLf & _

                        CurrentConditions.SkyText & vbCrLf

    for each objForecast in CurrentConditions.Forecast

      strCurrentWeather = strCurrentWeather & vbCRLF & _

                          objForecast.Day & " (" & objForecast.Date & ")" & _

                          ". Low: " & objForecast.Low & _

                          ", High: " & objForecast.High & ", " & _

                          objForecast.SkyText

    next

    MsgBox strCurrentWeather

  End If

End If

 

Properties

Methods

 


Derived from: IDispatch


Properties


Count
Integer, read-only.
Returns the number of RDOWeatherForecast objects in the collection.
 

Methods


Item(Index)
Returns an RDOWeatherForecast object with the specified index (1 through Count).