Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Multiple buttons help

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Multiple buttons help
  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 >>
 Multiple buttons help - 9/15/2007 8:48:09 AM   
  0verl0rd

 

Posts: 1
Score: 0
Joined: 9/15/2007
Status: offline
Ok, so im making an app right. and when you click a button an alert pops up and says what is encrypted in the button. (hello button says hello, blue button says blue)
but the one problem im having is in this script here.


      

when i compile it says "End If without Block If"
I have
       this script 12 more times only the buttons are named different and the message is different.

someone help me fix this please
Im using VB6.0 btw
 
 
Post #: 1
 
 RE: Multiple buttons help - 9/15/2007 9:05:42 AM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
you're probably going to have more luck posting this in a VBA forum.  but at a quick glance of the code posted looks wrong, you have End if's without the opening If statements:

Private Sub CMDAVIDUM_Click()
On Error GoTo ErrorAlarm
WS_Client.SendData "avidumad"
Exit Sub
ErrorAlarm:
MsgBox "Sorry, error occured"
End If   <--- only closing If statement
End Sub

Private Sub CMDCALCOMP_Click()
On Error GoTo ErrorAlarm
WS_Client.SendData "calcomp"
Exit Sub
ErrorAlarm:
MsgBox "Sorry, error occured"
End If   <--- only closing If statement
Missing "End Sub"
 

Private Sub CMDDIETAD_Click()
On Error GoTo ErrorAlarm
WS_Client.SendData "dietad"
Exit Sub
ErrorAlarm:
MsgBox "Sorry, error occured"
End If   <--- only closing If statement
Missing "End Sub"

it should be something like:

Private Sub
Do action here
End Sub

If Action = True Then   <--- Opening If statement
Do something here
End if    <--- Closing If statement

< Message edited by sheepz -- 9/15/2007 9:14:15 AM >

(in reply to 0verl0rd)
 
 
Post #: 2
 
 
 
  

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 >> Multiple buttons help 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