Ask a Question related to ASP, Design and Development.
-
Ray at #1
Re: Weather Script Help
Is this what the data always looks like? Like is it always full and space
delimited? If it were me, personally, I'd do:
metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
aWeatherInfo = Split(metar, " ")
''don't know what KPGD, are supposed to be
And you will then have an array of your weather info, like CLR is "clear" I
suppose, so whether the day is clear, cloudy, etc., that info will always be
aWeatherInfo(5), assuming that your original weather strings for formatted
the same.
Perhaps this uses field lengths to specify the fields though instead, and
you may have strings like:
KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2 TSE1757B12E27RAE1754
SLP167 T02890239 TSNO
KTR 093409 OFF 000DDF 3 CLD 0/100
And you'll have to split by position, but I doubt that's how your strings
come, since there would be issues if the temps reach 100, although it looks
like you're probably using Celcius.
Ray at home
--
Will trade ASP help for SQL Server help
"Dave Navarro" <dave@dave.dave> wrote in message
news:MPG.1999d3413ed09341989743@news-east.giganews.com...> I need help with a weather script I converted from Perl to ASP:
>
> Function RegEx(ByVal sData, ByVal expr)
> Dim objRegExpr
> Set objRegExpr = New regexp
> objRegExpr.Pattern = expr
> objRegExpr.Global = True
> objRegExpr.IgnoreCase = True
> Dim colMatches
> Set colMatches = objRegExpr.Execute(sData)
> If colMatches.Count Then
> RegEx = colMatches(0).Value
> End If
> set colMatches = Nothing
> set objRegExpr = Nothing
> End Function
>
> metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
> TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
>
> clouds = RegEx(metar, "\b(CLR|SKC|NSC|FEW|SCT|BKN|OVC)\d{3}?\b")
>
> This keeps returning an empty string "" instead of "CLR".
>
> Can anyone help?
>
> --Dave
Ray at Guest
-
weather web service
hi there, I was wondering how I can invoke some certain information about a certain city ( Mexico City ) using a WebService, I was trying with this... -
Weather temperature indicator, KDE
Does anyone know of a program for KDE that will just show the outside temperature down near the clock? Something similar to the Windows version of... -
weather web services site?
I'm working on a project to get weather info for my company and would like to know if there's any good weather web services site I can subscribe to?... -
Not sure weather to go ai to pdf or elsewhere
I created a business card in illustrator cs to get the initial "vector" quality, but... My printshop does not want it in illustrator. instead, either... -
Web Service to get the weather forecast
anybody Knows where can I find Web Service to get the weather forecast for all Worldwide Countries thanks in advance -- -
Tom B #2
Re: Weather Script Help
It looks like,
kpgd = location - Punta Gorda, Charlotte County Airport, FL, United States
the rest of the info can be found at
[url]http://weather.noaa.gov/weather/current/KPGD.html[/url]
I suspect you right, they are space separated so a split to array would be
the smart thing to do.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%23IgZl74WDHA.2056@TK2MSFTNGP11.phx.gbl...I> Is this what the data always looks like? Like is it always full and space
> delimited? If it were me, personally, I'd do:
>
> metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
> TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
>
> aWeatherInfo = Split(metar, " ")
>
> ''don't know what KPGD, are supposed to be
> And you will then have an array of your weather info, like CLR is "clear"be> suppose, so whether the day is clear, cloudy, etc., that info will alwaysTSE1757B12E27RAE1754> aWeatherInfo(5), assuming that your original weather strings for formatted
> the same.
>
> Perhaps this uses field lengths to specify the fields though instead, and
> you may have strings like:
> KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2looks> SLP167 T02890239 TSNO
> KTR 093409 OFF 000DDF 3 CLD 0/100
>
> And you'll have to split by position, but I doubt that's how your strings
> come, since there would be issues if the temps reach 100, although it> like you're probably using Celcius.
>
> Ray at home
>
>
> --
> Will trade ASP help for SQL Server help
>
>
> "Dave Navarro" <dave@dave.dave> wrote in message
> news:MPG.1999d3413ed09341989743@news-east.giganews.com...>> > I need help with a weather script I converted from Perl to ASP:
> >
> > Function RegEx(ByVal sData, ByVal expr)
> > Dim objRegExpr
> > Set objRegExpr = New regexp
> > objRegExpr.Pattern = expr
> > objRegExpr.Global = True
> > objRegExpr.IgnoreCase = True
> > Dim colMatches
> > Set colMatches = objRegExpr.Execute(sData)
> > If colMatches.Count Then
> > RegEx = colMatches(0).Value
> > End If
> > set colMatches = Nothing
> > set objRegExpr = Nothing
> > End Function
> >
> > metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
> > TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
> >
> > clouds = RegEx(metar, "\b(CLR|SKC|NSC|FEW|SCT|BKN|OVC)\d{3}?\b")
> >
> > This keeps returning an empty string "" instead of "CLR".
> >
> > Can anyone help?
> >
> > --Dave
>
Tom B Guest
-
Dave Navarro #3
Re: Weather Script Help
The string is "METAR" encoded weather data.
I could split the values into an array, but then my code converted from
Perl for decoding would not work. The rest of the code for determining
temperature, wind speed, wind direction, etc. is all working but that
one regular expression appears to not work.
--Dave
In article <#IgZl74WDHA.2056@TK2MSFTNGP11.phx.gbl>, "Ray at <%
=sLocation%>" <myfirstname at lane34 dot com> says...> Is this what the data always looks like? Like is it always full and space
> delimited? If it were me, personally, I'd do:
>
> metar = "KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2
> TSE1757B12E27RAE1754 SLP167 T02890239 TSNO"
>
> aWeatherInfo = Split(metar, " ")
>
> ''don't know what KPGD, are supposed to be
> And you will then have an array of your weather info, like CLR is "clear" I
> suppose, so whether the day is clear, cloudy, etc., that info will always be
> aWeatherInfo(5), assuming that your original weather strings for formatted
> the same.
>
> Perhaps this uses field lengths to specify the fields though instead, and
> you may have strings like:
> KPGD 051853Z AUTO 00000KT 10SM CLR 29/24 A3003 RMK AO2 TSE1757B12E27RAE1754
> SLP167 T02890239 TSNO
> KTR 093409 OFF 000DDF 3 CLD 0/100
>
> And you'll have to split by position, but I doubt that's how your strings
> come, since there would be issues if the temps reach 100, although it looks
> like you're probably using Celcius.
>
> Ray at homeDave Navarro Guest



Reply With Quote

