|
-
Jun 18th, 2003, 02:44 PM
#1
Thread Starter
Addicted Member
Logic Error
Could somebody give me an example of a logic error - perhaps if you have time to waste, write a small piece of code so I could try to track it down? (Pretty please)
many thanks
-
Jun 18th, 2003, 02:55 PM
#2
Hyperactive Member
You made a logic error in your post... Because your post doesn't make any logical sense
-
Jun 18th, 2003, 03:00 PM
#3
PowerPoster
Re: Logic Error
Originally posted by mbonfyre
Could somebody give me an example of a logic error - perhaps if you have time to waste, write a small piece of code so I could try to track it down? (Pretty please)
many thanks
VB Code:
Dim i As Integer
Private Sub Command1_Click()
For i = 1 To 5
Call HoseIt
DoEvents
Next i
End Sub
Sub HoseIt()
For i = 1 To 2
MsgBox "hosed"
Next i
End Sub
Code:
Private Sub Form_Load()
Dim d As Double
d = 4 * 10000
End Sub
Last edited by Muddy; Jun 18th, 2003 at 03:15 PM.
-
Jun 18th, 2003, 04:30 PM
#4
Just cut and paste the code onto a VB form, no need to add any controls.
Have fun.
VB Code:
Option Explicit
Private WithEvents cmdDeleteAll As VB.CommandButton
Private lstNumbers As VB.ListBox
Private Sub cmdDeleteAll_Click()
Dim lngItem As Long
For lngItem = 1 To lstNumbers.ListCount
lstNumbers.RemoveItem lngItem
Next
End Sub
Private Sub Form_Load()
Dim lngItem As Long
Set lstNumbers = Me.Controls.Add("VB.ListBox", "List1")
lstNumbers.Move 0, 0, 1000, ScaleHeight
lstNumbers.Visible = True
For lngItem = 1 To 10
lstNumbers.AddItem lngItem
Next
Set cmdDeleteAll = Me.Controls.Add("VB.CommandButton", "List1")
cmdDeleteAll.Caption = "Delete All"
cmdDeleteAll.Move 0, 0, 1000
cmdDeleteAll.Visible = True
End Sub
-
Jun 18th, 2003, 09:34 PM
#5
The picture isn't missing
Logic error:
1=2
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jun 18th, 2003, 10:20 PM
#6
click here
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jun 19th, 2003, 12:42 AM
#7
Hyperactive Member
-
Jun 19th, 2003, 08:09 AM
#8
PowerPoster
Originally posted by BuggyProgrammer
Logic error:
1=2
actually nothing wrong with that ... false expressions are allowed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|