Results 1 to 5 of 5

Thread: Fix - inconsistant?

  1. #1

    Thread Starter
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375

    Fix - inconsistant?

    I have found a somewhat...intruiging anomaly in VB.

    Close any instances of VB that are running (this is very important).
    Open another one. Make a project with a form and a commandbutton. Add this code:

    VB Code:
    1. Private Sub Command1_Click()
    2.     Me.Print Fix(0.42 * 100)
    3.     Me.Print Fix(0.42 * 100)
    4. End Sub
    when you press the button, you should see a 42 and a 41...generated by the same code. That really puzzles me. If you press it again, it should give you 41 everytime, until you restart VB and run it again.

    Any explanation?
    You just proved that sig advertisements work.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    I get

    41
    41

    VB6 SP 5 Win2k
    -= a peet post =-

  3. #3
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    I get

    47
    kazoo

    VBWollongong Win 1.0 Beta
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  4. #4
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    I get

    41
    41

    VB6 SP 5 Win98SE

  5. #5

    Thread Starter
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375


    This is on VB6 SP4.
    Attached Images Attached Images  
    You just proved that sig advertisements work.

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