954,558 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help Need Help About Elavator Simulation For Vb 6

Need help about elevator sumulation for vb 6

morph214
Newbie Poster
6 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

And...?

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Is this a homework project? If so, what are the specs? what have you done so far? What do you need help with?

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

ive finish almost everything but im having a problem in fixing the timer.. because every image just jump to the floor that I specify not like an elevator that passes thru each floor

morph214
Newbie Poster
6 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

yes its a homework project... the project is to make an elevator simulation with 15 floors, ive finish this so far

Private Sub cmddown_Click()
          a = 2
          For x = a To txt1
          Call Timer2_Timer
Next
End Sub
 
Private Sub cmdup_Click()
          a = 2
          For x = a To txt1
          Call Timer1_Timer
Next
End Sub
 
Private Sub Form_Load()
          Timer1.Enabled = False
          Timer2.Enabled = False
End Sub
 
Private Sub Timer1_Timer()
          For x = 1 To 1
                    Image1.Top = Image1.Top - 360
          Next
End Sub
 
Private Sub Timer2_Timer()
          For x = 1 To 1
                    Image2.Top = Image2.Top + 360
          Next
End Sub


my problem is the elevator jumps to the floor i specify but I need it to pass thru every floor and stops to the floor i specify

morph214
Newbie Poster
6 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

Can you attach the project to a post, or e-mail it to me (in a .zip [e-mail is in my profile]) so that I can have the pictures and everything needed for this to run?

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

already solved the problem thank you to those who help me.....

morph214
Newbie Poster
6 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

For those of us (myself included) who have been tracking this thread.... what was the solution?

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

here is my solution, but still not perfect. hope this still helps!

Private Sub cmddown_Click()
x = InputBox("Enter Desired Floor", "Elevator Program", "1")
txt1 = x
If (x >= 1) Or (x <= 15) Then
Timer2.Enabled = True
Else
y = MsgBox("Floor not available", 48, "Warning")
End If
End Sub

Private Sub cmdemr_Click()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub

Private Sub cmdexit_Click()
End
End Sub

Private Sub cmdup_Click()
x = InputBox("Enter Desired Floor", "Elevator Program", "1")
txt1 = x
If (x >= 1) Or (x <= 15) Then
Timer1.Enabled = True
Else
y = MsgBox("Floor not available", 48, "Warning")
End If
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub

Private Sub Timer1_Timer()
Image1.Top = Image1.Top - 180
End Sub

Private Sub Timer2_Timer()
Image1.Top = Image1.Top + 180
End Sub

Private Sub Timer3_Timer()
x = txt1
Select Case x
    Case 1
        y = 5160
    Case 2
        y = 4800
    Case 3
        y = 4440
    Case 4
        y = 4080
    Case 5
        y = 3720
    Case 6
        y = 3360
    Case 7
        y = 3000
    Case 8
        y = 2640
    Case 9
        y = 2280
    Case 10
        y = 1920
    Case 11
        y = 1560
    Case 12
        y = 1200
    Case 13
        y = 840
    Case 14
        y = 480
    Case 15
        y = 120
End Select


If Image1.Top = y Then
    Timer1.Enabled = False
    Timer2.Enabled = False
End If
End Sub
morph214
Newbie Poster
6 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

Hey I want to do the same thing but using buttons to select floors I have a windows with just label that says the level that the elevator is going and I want to use a panel to select each level with buttons but I just have managed to make that each level change color but just go up from level one to ten I dont know if someone is getting the idea :S my skype is jdiaz1302 or email jrg.dz1@gmail.com the only thing I know for sure is that I have to use timer

jdiaz1302
Newbie Poster
6 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You