RDOWeatherConditions object

 

RDOWeatherConditions object represents the current weather conditions at a given location .

 

Returned by:

RDOWeatherLocation.GetCurrentConditions

 

See also: RDOWeatherServices, RDOWeatherLocations, RDOWeatherLocation, RDOWeatherForecastCollection, 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

 

 


Derived from: IDispatch


Properties


Attribution Specifies the source of the weather information.
String, read-only.
 
Attribution2 Specifies the additional source of the weather information.
String, read-only.
 
Date Specifies the current date.
DateTime read-only.
 
Day Specifies the week day for the forecast.
String, read-only.
 
FeelsLike Specifies the temperature of how the current weather feels like.
Integer, read-only.
 
Forecast Returns the RDOWeatherForecastCollection  object that contains the list of RDOWeatherForecast object containing the forecast for the next few days..
 
Humidity Specifies the current numerical humidity value.
Integer, read-only.
 
Latitude Specifies the geographical latitude of the location.
String, read-only.
Can be an empty string if the exact latitude is not known.
 
LocationGmtOffset Specifies the GMT offset (in hours) of the location.
Integer, read-only.
 
LocationName The name of the location, e.g. "Phoenix, AZ".
String, read-only.
 
LocationUrl Specifies the URL for the web page of the weather service that contains weather information for the specified location.
String, read-only.
 
LocationZipCode The zip of the location, e.g. "90210".
String, read-only.
Can be an empty string if the zip code is not known or is not applicable.
 
Longitude Specifies the geographical longitude of the location.
String, read-only.
Can be an empty string if the exact longitude is not known.
 
ObservationPoint Specifies where the current weather information is observed from.
String, read-only.
 
ObservationTime Specifies when the current weather information is observed at.
DateTime, read-only.
 
Provider Specifies the provider of the weather information.
String, read-only.
 
ShortDay Specifies a day in abbreviated form.
String, read-only.
 
SkyCode Specifies an integer code for the current weather conditions.
Integer, read-only.
 
SkyText Specifies one to two words describing current weather conditions.
String, read-only.
 
Temperature Specifies the current temperature of the location.
Integer, read-only.
 
TemperatureUnits Specifies the unit for the temperature of the location, read-only.

Can be one of the rdoTemperatureUnits enums:
Celsius = 0
Fahrenheit = 1
 
WindDisplay A string that describes the current wind conditions.
String, read-only.
 
WindSpeed Specifies the current numerical wind speed value.
Integer, read-only.