Jump to content

Question


Sardith
 Share

Recommended Posts

If $Celsius = 1 or 2 or 3 or 4 Then

I know this won't work. Is there any way to do: If $Celsius = 1 through 4? 1 or 2 etc. Is not working, I can't figure it out for some reason. Any help would be great.

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

If $Celsius = 1 or 2 or 3 or 4 Then

I know this won't work. Is there any way to do: If $Celsius = 1 through 4? 1 or 2 etc. Is not working, I can't figure it out for some reason. Any help would be great.

If I interpret your problem correctly:

If $Celsius > 0 Or $Celsius < 5 Then

; What to do when Celsius is 1, 2, 3, or 4.

EndIf

...should be sufficient, as long as you're dealing with integers and not floating point numbers.

You might also lookup StringRegExp() for some ways to really dial in your If tests.

-S

Edited by Locodarwin
(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]
Link to comment
Share on other sites

Another question, so I can understand this for later use.

$Code = "48313"
$File = _TempFile()
INetGet("http://www.weather.com/weather/local/" & $Code, $File, -1, 0)
$Line = FileReadLine($File, 29)
$LineA = StringSplit($Line, "")
$Title = FileReadLine($File, 18)
;Get city and state name, 34 from left, 22 from the right
$CityNameA = StringTrimLeft($Title, 34)
$CityName = StringTrimRight($CityNameA, 22)
$Fahrenheit = $LineA[38] & $LineA[39] & " °F"; Temperature 38, 39

Is there a way to look the file that you used INetGet, so I can choose what lines I want to read, other then guessing numbers?

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Whoops, replace the OR with an AND! :whistle:

Thanks for catching my goof, Valuator.

-S

(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...