RDOWeatherLocations object

 

RDOWeatherLocations represents a collection of the RDOWeatherLocation objects returned by thee RDOWeatherServices.Locations property.

 

Returned by:

RDOWeatherServices.Locations

 

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

 

The example below displays all weather locations from the default store.

'enumerate all existing weather locations

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

for each objLocation in Session.WeatherServices.Locations

  Debug.Print objLocation.Name

next

 

Properties

Methods

 


Derived from: IDispatch


Properties


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

 

Methods


Add(Location)
Add the specified RDOWeatherLocation object to the collection.  A new RDOWeatherLocation object can be created by calling RDOWeatherLocations.ResolveLocation, which can return zero or more objects in the RDOWeatherLocationsStatic collection.

Returns the new RDOWeatherLocation object (different from the object passed as the argument).

The parent RDOWeatherServices object must be saved (RDOWeatherServices.Save) after the collection is modified.

'resolve a weather location name and add it if it does not yet exist

strLocationToAdd = "Санкт Петербург"

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

set WeatherServices = Session.WeatherServices

WeatherServices.LanguageCodeID = "de-de" 'return data in German

set locations = WeatherServices.ResolveLocation(strLocationToAdd)

Debug.Print "Found " & locations.Count & " matching locations for " & strLocationToAdd & ":"

for each objLocation in locations

  Debug.Print objLocation.Name

next

if locations.Count > 0 Then

  set objNewLocation = locations(1) 'pick the first location

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

    Debug.Print "Adding location " & objNewLocation.Name

    WeatherServices.Locations.Add(objNewLocation)

    WeatherServices.Save

  End If

End If

 

Clear
Deletes all objects from the collection.

The parent RDOWeatherServices object must be saved (RDOWeatherServices.Save) after the collection is modified.
 
Item(Index)
Returns an RDOWeatherLocation object with the specified index (1 through Count).

 
Remove(LocationOrIndex)
Remove the specified location object.
LocationOrIndex parameter can either be an RDOWeatherLocation object, string with the  Name or Code of the location, or an integer index (1 through Count).

The parent RDOWeatherServices object must be saved (RDOWeatherServices.Save) after the collection is modified.