|
Dim nws As Object
Private Sub cmbState_Click()
Dim county_list As Variant
Dim county As Variant
' clear out previous county
entries
lstCounties.Clear
MousePointer = vbHourglass
' set the state, which causes the
' data to be retrieved from the
N.W.S.
nws.State = cmbState.Text
MousePointer = vbDefault
' get the list of counties as a
variant,
' then reference as an array
county_list = nws.Counties
For Each county In county_list
lstCounties.AddItem county
Next
End Sub
Private Sub Form_Load()
Dim states As Variant
Dim st As Variant
Set nws =
CreateObject("nws.Scriptlet")
states = Array( _
"AL", "AK", "AZ", "AR", "CA", _
"CO", "CT", "DE", "FL", "GA", _
"HI", "ID", "IL", "IN", "IA", _
"KS", "KY", "LA", "ME", "MD", _
"MA", "MI", "MN", "MS", "MO", _
"MT", "NE", "NV", "NH", "NJ", _
"NM", "NY", "NC", "ND", "OH", _
"OK", "OR", "PA", "PR", "RI", _
"SC", "SD", "TN", "TX", "UT", _
"VT", "VA", "WA", "WV", "WI", _
"WY")
For Each st In states
cmbState.AddItem st
Next<br>
End Sub<br>
Private Sub lstCounties_DblClick()
Dim nwsRes As Variant
nwsRes =
nws.GetCounty(lstCounties.Text)
forecast.Text = nwsRes(2)
forecastDate.Caption = nwsRes(1)
End Sub
|
|