Article View: comp.lang.basic.visual.misc
Article #330General Procedure Problem
From: Gavin Rooke
Date: Sat, 14 Dec 2002 18:04
Date: Sat, 14 Dec 2002 18:04
52 lines
3090 bytes
3090 bytes
I have the following as a general procedure. The program is for a
snooker/pool club. This bit manages the tables. The way it works is to get
the table number -"num" when the procedure is called when the table is
clicked on the form to begin play...
The problem is every table calls the procedure so when mulitple tables are
being played on the variables only record the last table clicked so all
tables end up displaying the same and wrong price. Is there anyway to set
the variables up using the paramater.
I'm a bit of a newbie, so i aploigise if the mistake is obvious.
Look forward to your response.
Thnanks.
Gavin
------
Public Sub PlayTable(num As Integer)
If lblStatusTable1.Caption = "Member Playing" Then
Dim intResult As Integer
intResult = MsgBox("Are you sure you want to end the game on " & (num) &
"?", vbQuestion + vbYesNo + vbDefaultButton1 + vbApplicationModal, "Start
Game")
If intResult = vbYes Then
lblStatusTable.Caption = "Game Ended"
finish = tmrTable & (num)
lblTableCost.Enabled = True
lblTimeTable.Visible = True
lbltime.Caption = elapsed1 & " minutes"
cost = elapsed * 0.2
lblTableCost.Caption = "�" & cost & "0"
ElseIf intResult = vbNo Then
'Do nothing
End If
End If
If lblStatusTable1.Caption = "Available" Then
Dim intResult As Integer
intResult = MsgBox("You are allocating Table " & (num) & " to a member.
Is this correct?", vbQuestion + vbYesNo + vbDefaultButton1 +
vbApplicationModal, "Start Game")
If intResult = vbYes Then
tmrTable1.Enabled = True
elapsed1 = 0
lblStatusTable1.Caption = "Member Playing"
ElseIf intResult = vbNo Then
'Do nothing
End If
End If
End Sub
Technical Details
Message-ID:
<rtKK9.176$Om2.36194@newsfep2-win.server.ntli.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!newsfep2-win.server.ntli.net.POSTED!53ab2750!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111c14,89759baaa84935fc,start X-Google-Attributes: gid111c14,public X-Google-Thread: 108062,89759baaa84935fc,start X-Google-Attributes: gid108062,public X-Google-Thread: 110e3b,94638f7c29d42385 X-Google-Attributes: gid110e3b,public X-Google-ArrivalTime: 2002-12-14 10:09:39 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!newsfep2-win.server.ntli.net.POSTED!53ab2750!not-for-mail From: "Gavin Rooke" <gavrooke@mail.portland.co.ukREMOVE> Newsgroups: comp.lang.basic.visual.misc,cz.comp.lang.basic.visual,no.it.programmering.visual-basic Subject: General Procedure Problem Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <rtKK9.176$Om2.36194@newsfep2-win.server.ntli.net> Date: Sat, 14 Dec 2002 18:04:52 -0000 NNTP-Posting-Host: 213.104.180.207 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep2-win.server.ntli.net 1039889367 213.104.180.207 (Sat, 14 Dec 2002 18:09:27 GMT) NNTP-Posting-Date: Sat, 14 Dec 2002 18:09:27 GMT Organization: ntlworld News Service