|
-
Jul 21st, 2001, 04:52 PM
#1
Thread Starter
New Member
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?
-
Jul 21st, 2001, 05:14 PM
#2
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|