The Basics of VB6: Difference between revisions
Jump to navigation
Jump to search
m Unsorted VB6 Notes moved to The Basics of VB6 |
|||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
These notes can be organized later. | These notes can be organized later. | ||
=== | === Select Case (Switch) === | ||
CASE in Visual BASIC does not "fall through" like in C. | |||
Select Case Button.Key | |||
Case "ListCache" | |||
mnuListCache_Click | |||
Case "Refresh" | |||
mnuRefresh_Click | |||
Case "simmode" | |||
cmdSimMode_Click | |||
End Select | |||
Select Case tcpClient.State | |||
Case 0 | |||
tcpClient.RemoteHost = cboRemoteHost | |||
SessionConnect | |||
Case 7 | |||
lblStatus.Caption = "Connected" | |||
Case 9 | |||
lblStatus.Caption = "Connection Error" | |||
End Select | |||
Case based on more than one condition | |||
Select Case True | |||
Case strMessage Like "*OK*" And lblStatus.Caption = "Connected" | |||
blnReceivedAll = True | |||
Case strMessage Like "*OK*" And lblStatus.Caption = "retrieving." | |||
lblStatus.Caption = "retrieving.." | |||
blnReceivedAll = True | |||
Case Else | |||
Set LoopTime = New TimerClass: tmrDisconnect.Enabled = True | |||
End Select | |||
== | === Public Declarations === | ||
Public strCurrentTool As String | |||
Public fMainForm As frmQAB | |||
Public cn As ADODB.Connection | |||
Public rsCompanies As ADODB.Recordset | |||
Public Const dbtContact = "contact" | |||
| |
Latest revision as of 09:55, 2 February 2008
These notes can be organized later.
Select Case (Switch)
CASE in Visual BASIC does not "fall through" like in C.
Select Case Button.Key Case "ListCache" mnuListCache_Click Case "Refresh" mnuRefresh_Click Case "simmode" cmdSimMode_Click End Select
Select Case tcpClient.State Case 0 tcpClient.RemoteHost = cboRemoteHost SessionConnect Case 7 lblStatus.Caption = "Connected" Case 9 lblStatus.Caption = "Connection Error" End Select
Case based on more than one condition
Select Case True Case strMessage Like "*OK*" And lblStatus.Caption = "Connected" blnReceivedAll = True Case strMessage Like "*OK*" And lblStatus.Caption = "retrieving." lblStatus.Caption = "retrieving.." blnReceivedAll = True Case Else Set LoopTime = New TimerClass: tmrDisconnect.Enabled = True End Select
Public Declarations
Public strCurrentTool As String
Public fMainForm As frmQAB
Public cn As ADODB.Connection
Public rsCompanies As ADODB.Recordset
Public Const dbtContact = "contact"