Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27360

Trying to get back into VB coding... Issue with writer.writeint8

$
0
0
Forgive me if this has been answered before. I tried doing a search for writeint8 and the search came up with nothing that seemed to be about what I was needing help with.

I originally took a class on Basic Programming in high school, and I am trying my hand at using Visual Basic now. Currently using Visual Basic 2010 Express. I have a file that I am trying to write to. But there is a part with writer.writeint8 which has me baffled.

My code looks like this (This may be sloppy just a heads up, this was learned following a tutorial).

Code:

                Writer.Position = 6245
                Writer.WriteInt8(TextBox7.Text)
                Writer.Position = 6287
                Writer.WriteInt8(TextBox6.Text)

Let's say at those positions I have 05 and 06 respectively.

For some reason, when it writes to the file, the value it writes to 6245 always shows up as 00. The value it writes to 6287 shows up as what it previously was the first time (06). But if I load the file again and write it again, the 6245 is still 00, but the second time writing it the 6287 shows up as whatever I tried to change it to.

I have tried using writer.writeint16 for these, and moving the location to 6244 and 6286, and it works fine. The only problem is that both of these values are less than 255, so I only need them as 8-bit, not 16-bit.

I have other values that write using writer.writeint16 and 32 that work flawlessly everytime.

Does anyone know of any other way to write a single value besides writeint8 that might work better?

Viewing all articles
Browse latest Browse all 27360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>