General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 25th, 2012, 12:03 AM
Matt2689 Matt2689 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 1 Matt2689 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 29 sec
Reputation Power: 0
Basic vbs help

hey guys I have a script that asks for the temperature and returns with an activity based on it - but it doesnt work? any suggestions would be great


Code:
 Dim temp temperature = Inputbox("What is the current temperature?") IF temp >=85 THEN 	Msgbox "You should go swimming!" ELSEIF temp 85 and temp >=70 THEN 	Msgbox "You should play tennis!" ELSEIF temp 69 and temp >=32 THEN 	Msgbox "You should play golf!" ELSEIF temp 31 and temp >=0 THEN 	Msgbox "You should go ballroom dancing!" ELSEIF temp <0 THEN 	Msgbox "You should go skiing!" END IF

Reply With Quote
  #2  
Old May 24th, 2012, 10:39 AM
mcv2002 mcv2002 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 1 mcv2002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 51 sec
Reputation Power: 0
RE: help

Matt,

See if this helps you:

Dim temp
temp = Inputbox("What is the current temperature?")
IF temp >=85 THEN
MsgBox ("You should go swimming!")
ElseIF temp <=84 and temp >=70 Then
MsgBox "You should play tennis!"
ElseIF temp <=69 and temp >=32 THEN
MsgBox "You should play golf!"
ElseIF temp <=31 and temp >=0 THEN
MsgBox "You should go ballroom dancing!"
ElseIf temp <0 Then
MsgBox "You should go skiing!"
END IF

Reply With Quote
  #3  
Old January 21st, 2013, 01:58 PM
65bit 65bit is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 65bit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 36 m 42 sec
Reputation Power: 0
Quote:
Originally Posted by mcv2002
Matt,

IF temp >=85 THEN
MsgBox ("You should go swimming!")
ElseIF temp <=84 and temp >=70 Then
...
END IF


You could/should try that as '<85' instead of '<=84'.. you'll be missing values between 84 & 85 otherwise.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Basic vbs help


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap