Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-2008, 02:48 PM
kresh7's Avatar   
kresh7 kresh7 is offline
Programming Expert
 
Join Date: Jun 2007
Location: Kosovo
Posts: 476
Rep Power: 10
kresh7 will become famous soon enoughkresh7 will become famous soon enough
Send a message via MSN to kresh7
Default Help with case

i need help with this how can i return back to first select case

thats the code i got
Code:
dim clicks as integer 

clicks = clicks + 1
select case 
case 1
msgbox "Hi"
case 2
msgbox "Bye"
end select
now i want when theres no case anymore that i returns to case one and repeat everything again
this code comes in a command button and im using vb6

Last edited by TcM; 03-16-2008 at 10:19 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-14-2008, 02:57 PM
Chambered's Avatar   
Chambered Chambered is offline
Newbie
 
Join Date: Nov 2007
Location: La Crosse
Posts: 11
Rep Power: 0
Chambered is on a distinguished road
Send a message via ICQ to Chambered Send a message via AIM to Chambered
Default Re: Help with case

You could create a while loop and a boolean variable. When you hit the end of the select statement, inside the Case Else part, set the variable to true. Then in each other case set the variable to false. So it'll keep looping until one of the cases is chosen.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-15-2008, 03:11 PM
kresh7's Avatar   
kresh7 kresh7 is offline
Programming Expert
 
Join Date: Jun 2007
Location: Kosovo
Posts: 476
Rep Power: 10
kresh7 will become famous soon enoughkresh7 will become famous soon enough
Send a message via MSN to kresh7
Default

can you show an example code ?

cuz im pretty new with while loop and loop statment

Last edited by TcM; 03-16-2008 at 10:19 AM. Reason: Merged
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-16-2008, 10:21 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default Re: Help with case

Sorry but I read this like 5 times and I can't understand what you really want.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-16-2008, 11:34 AM
kresh7's Avatar   
kresh7 kresh7 is offline
Programming Expert
 
Join Date: Jun 2007
Location: Kosovo
Posts: 476
Rep Power: 10
kresh7 will become famous soon enoughkresh7 will become famous soon enough
Send a message via MSN to kresh7
Default Re: Help with case

example:
Code:
dim clicks as integer 
clicks = clicks + 1 
select case 
case 1
timer1.enabled = true 
case 2
timer1.enabled = false
end select
and now i want that when the person clicks again on the command button he goes again to case one and then 2 and then the hole starts again like an endless loop

Last edited by TcM; 03-16-2008 at 02:35 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 03-16-2008, 02:42 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default Re: Help with case

Yeah.. but what is the purpose of this?????

It seems like you want to make that when the user clicks the timer starts and when he clicks again it stops, when clicked again it starts again, when clicked again it stops again etc.. right?? If yes then you SHOULD NOT use case, it's not the right technique to do this...

Code:
If Timer1.Enabled = False Then
Timer1.Enabled = True
Else: Timer1.Enabled = False
End If
AND PLEASE WHEN YOU INCLUDE SOME CODE USE TAGS!!

THANKS.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial - Smarterchild copy travy92 VB Tutorials 19 09-25-2008 07:05 PM
Help - Assembly: counting lower/upper case chars from string Treymac General Programming 1 03-06-2008 08:38 AM
Nesting CASE in IF ( or ) Nesting IF in CASE pino C# Programming 1 02-16-2008 01:46 AM
Nesting CASE in IF ( or ) Nesting IF in CASE pino General Programming 1 02-15-2008 05:19 PM
Assign a keyboard key to a JButton. gszauer Java Help 4 01-08-2008 03:09 PM


All times are GMT -5. The time now is 05:21 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads