Results 1 to 2 of 2

Thread: put problems

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Posts
    1

    Unhappy put problems

    I have a problem with put.

    I'm trying to modify an offset using put but it doesn't work.

    Private Sub Command5_Click()
    Dim Value1, Value2 As Byte
    Value1 = 62
    Value2 = 64
    Open LieroPath For Binary As #1
    Put #1, &H10FD2, Value1
    Put #1, &H1106F, Value1
    Put #1, &H110D3, Value1
    Put #1, &H11069, Value2
    Put #1, &H110CD, Value2
    Close #1
    End Sub

    What did I do wrong?

  2. #2
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    The problem is probably related to how you dimmed the variables. According to what you're showing, Value1 is a variant, not a byte. If you want to dim multiple vars on a single line, you have to use "Dim Value1 As Byte, Value2 As Byte" and so on. With a variant, Put will first write an integer that is the data type of the variable it's getting, and then it writes the data. Did you see if Value2 is working as it should? From what you're showing, the method itself is fine, as long as the file is there, and has enough data in it so that the positions you're giving Put are valid.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

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