-
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?
-
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.