Results 1 to 9 of 9

Thread: ? easy ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Holland
    Posts
    98

    ? easy ?

    Dim x As String
    Dim i As Integer
    Dim a, b

    Open "e:\temp\dummy.tmp" For Append As 1
    x = "x"

    '1000 = 3000 bytes
    '10000 = 30 kb

    a = 1000
    b = a / 100

    For i = 1 To a
    Print #1, x
    'Debug.Print i / b
    label1.caption = i /b
    Next i

    Close 1


    this code works fine but
    label1.caption = i/b doesn`t work ! (it only displays 100
    after it`s done)
    debug.print does work !!!!

    how do i make the label work ?
    Arjan Nutz

  2. #2
    Addicted Member _Yoyo's Avatar
    Join Date
    Apr 2001
    Location
    Dominican Republic
    Posts
    187

    Red face Try...

    Try dimensioning A & B as Long...
    The biggest man you ever did see was once just a baby.

    Bob Marley

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Holland
    Posts
    98
    Sorry doesn`t work

    and rember debug.print DOES WORK !!!
    Arjan Nutz

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Holland
    Posts
    98
    Sorry _Yoyo doesn`t work

    and rember debug.print DOES WORK !!!
    Arjan Nutz

  5. #5
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    ?
    Works For Me :
    Code:
    Private Sub Form_Load()
        Dim x As String
        Dim i As Integer
        Dim a As Integer, b As Integer
        
        Open "C:\Documents and Settings\lhrakr1\Desktop\dummy.tmp" For Append As #1
                x = "x"
                
                 '1000 = 3000 bytes
                 '10000 = 30 kb
                
                a = 1000
                b = a / 100
                
                For i = 1 To Int(a)
                        Print #1, x
                         ' Debug.Print i / b
                        Label1.Caption = Int(i) / Int(b)
                Next i
        Close 1
    End Sub

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  6. #6
    Addicted Member Pickler's Avatar
    Join Date
    May 2001
    Location
    nffanb
    Posts
    248
    If you refresh the form it should work

    label1.Caption=i/b
    form1.Refresh

    Cheers

  7. #7
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    oh I see now sorry, you'll need to set the AUTOREDRAW PROPERTY of the form to true for the label bit

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Holland
    Posts
    98
    Thanks Pickler

    works great
    Arjan Nutz

  9. #9
    Tygur
    Guest
    alex_read,
    I just wanted to let you know that setting AutoRedraw to True does not fix the problem. I suggest you look over the documentation on AutoRedraw and try to understand it better..

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