Results 1 to 8 of 8

Thread: Logic Error

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Location
    Propped up at a PC near you...
    Posts
    194

    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

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    You made a logic error in your post... Because your post doesn't make any logical sense

  3. #3
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    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:
    1. Dim i As Integer
    2. Private Sub Command1_Click()
    3.     For i = 1 To 5
    4.         Call HoseIt
    5.         DoEvents
    6.     Next i
    7. End Sub
    8. Sub HoseIt()
    9.     For i = 1 To 2
    10.         MsgBox "hosed"
    11.     Next i
    12. 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.

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Just cut and paste the code onto a VB form, no need to add any controls.

    Have fun.

    VB Code:
    1. Option Explicit
    2.  
    3. Private WithEvents cmdDeleteAll As VB.CommandButton
    4. Private lstNumbers As VB.ListBox
    5.  
    6. Private Sub cmdDeleteAll_Click()
    7.     Dim lngItem As Long
    8.     For lngItem = 1 To lstNumbers.ListCount
    9.         lstNumbers.RemoveItem lngItem
    10.     Next
    11. End Sub
    12.  
    13. Private Sub Form_Load()
    14.     Dim lngItem As Long
    15.    
    16.     Set lstNumbers = Me.Controls.Add("VB.ListBox", "List1")
    17.     lstNumbers.Move 0, 0, 1000, ScaleHeight
    18.     lstNumbers.Visible = True
    19.    
    20.     For lngItem = 1 To 10
    21.         lstNumbers.AddItem lngItem
    22.     Next
    23.    
    24.     Set cmdDeleteAll = Me.Controls.Add("VB.CommandButton", "List1")
    25.     cmdDeleteAll.Caption = "Delete All"
    26.     cmdDeleteAll.Move 0, 0, 1000
    27.     cmdDeleteAll.Visible = True
    28.    
    29. End Sub

  5. #5
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Logic error:
    1=2
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    click here

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7
    Hyperactive Member Libero's Avatar
    Join Date
    Jun 2000
    Location
    Swedish viking
    Posts
    460
    Originally posted by crptcblade
    click here

    ZzzzZZZzzzzZZZz!!

  8. #8
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    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
  •  



Click Here to Expand Forum to Full Width