Sign in to follow this  
Followers 0
Sardith

Question

8 posts in this topic

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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If $Celsius = 1 or 2 or 3 or 4 Then oÝ÷ ØêÚºÚ"µÍÝÚ]Ú    ÌÍÐÙ[Ú]ÂØÙHBËØÙHËØÙHÂËØÙH
Ë[ÝÚ]Ú
Edited by Paulie

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If $Celsius > 0 And $Celsius < 5 Then

because

If $Celsius > 0 or $Celsius < 5 Then

wont work

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Thanks a lot Valuater


[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]

Share this post


Link to post
Share on other sites

Welcome!

8)


NEWHeader1.png

Share this post


Link to post
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]

Share this post


Link to post
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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0