Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


what's the error?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2790
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> what's the error?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 what's the error? - 4/25/2005 12:13:00 AM   
  barocco


Posts: 49
Score: 0
Joined: 4/24/2005
From:
Status: offline
want to know what the error is? "else deal2()" ,syntax error?~~~thanks~~~[:p]
my code is:

num1=inputbox("Input a number:")
if (num1>10) then deal1()
else deal2()
end if

sub deal1()
msgbox "lager than 10"
end sub

sub deal2()
msgbox "not larger than 10"
end sub

_____________________________

Godness light my path
 
 
Post #: 1
 
 Re: what's the error? - 4/25/2005 12:38:36 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Replace:

else deal2()

with:

else
deal2()

(in reply to barocco)
 
 
Post #: 2
 
 Re: what's the error? - 4/25/2005 12:43:03 AM   
  Zifter


Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
you'll also need to replace

if (num1>10) then deal1()

with

if (num1>10) then
deal1()

That makes:
if (num1>10) then
deal1()
else
deal2()
end if

If you have an "if" condition without an "else", you can write it on the same line, otherwise you'll have to put it on the next.

HTH

(in reply to barocco)
 
 
Post #: 3
 
 Re: what's the error? - 4/25/2005 1:36:43 AM   
  barocco


Posts: 49
Score: 0
Joined: 4/24/2005
From:
Status: offline
thanks a lot~~~~thank you all~~thanks for your suggestions~enlightening...~~~~~~

(in reply to barocco)
 
 
Post #: 4
 
 Re: what's the error? - 4/25/2005 11:38:47 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
You're welcome.

(in reply to barocco)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> what's the error? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts