offsets to textbox
offsets to textbox
hey
im using vb 06
i was wondering how i could write a offsets value (convert to asci first)
into a text box in vb.
im using vb 06
i was wondering how i could write a offsets value (convert to asci first)
into a text box in vb.
well you can say
Code: Select all
txtOffsetTextBox.Text = offset.ToString() if you want it in decimal if I remember right
txtOffsetTextBox.Text = offset.ToString("X") if you want it in hex I think
I understand vb06 differs from 2005.. but I'm unsure if that would be correct OwnZ, heres what would work in 2005
Edit* After re-reading your post it seems you want the value from the current position of the reader in the stream, again 2005 code here (also assuming you initialized your reader and it is at the correct position)
Code: Select all
txtOffsetTextBox.Text = offset 'Display the integer as is
txtOffsetTextBox.Text = Hex(offset) 'Display the base 16 conversion of the integer
Code: Select all
txtOffsetTextBox.Text = reader.ReadInt32() 'Will read the integer at the current position in the current stream
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
Halo 3 Research Thread - Contribute to the research into Halo 3.
I'm pretty sure you have it backwardsspikes122 wrote:hmmm so ok so say if i had the offsets
11111111 = o
and 22222222=k
in vb 06
how would i put that into one box
im not very gd at vb memory
thanks
you meant:
Code: Select all
int o = 11111111
well it would be:
Code: Select all
txtOffsetTextBox.Text = o.ToString()
ok to give a variable a value you need to put the value on the right side of the equal sign.
So you need to make it s = 87 not 87 = s
then you need to do this
textbox.Text = s.ToString()
this code would be for displaying 87 in the textbox, not the value at offset 87, you would need to have a binaryreader for that
So you need to make it s = 87 not 87 = s
then you need to do this
textbox.Text = s.ToString()
this code would be for displaying 87 in the textbox, not the value at offset 87, you would need to have a binaryreader for that
VB handles the conversions, thus you don't need to have the .ToString()'s and thus you won't have to convert the value once read,
Simple as that, also Spike if you could learn to grasp the English language a little better it would be most appreciated; it is quite tiresome to read dribble.
Code: Select all
dim Value as Integer = 'Read the value here
TextBox1.Text = Value
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
Halo 3 Research Thread - Contribute to the research into Halo 3.
im still not really sure
so my ffset for the first letter of the players name is 1111111 so the offset has a value of 87 but i want to convert it text into the textbox
dim Value as Integer = 'Read the value here
TextBox1.Text = Value
so in that would i juust write the offset after integer part
its just i cant write the value myself because it changes for each server i make so it needs to get the players name offset and convert to text into the textbox so i can see every players names
and lol its because i was typing fast
so my ffset for the first letter of the players name is 1111111 so the offset has a value of 87 but i want to convert it text into the textbox
dim Value as Integer = 'Read the value here
TextBox1.Text = Value
so in that would i juust write the offset after integer part
its just i cant write the value myself because it changes for each server i make so it needs to get the players name offset and convert to text into the textbox so i can see every players names
and lol its because i was typing fast
Post the code that you use to open up the map in a reader and seek to your specific '111..' offset.
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
Halo 3 Research Thread - Contribute to the research into Halo 3.
BinaryReader.ReadChar() returns a char
You can make a new String out of a char or chars
so:
That's how I would do it in C# converted to vb, Not sure if it works exactly like that in VB
You could try just sending the char into the textbox.Text, maybe vb converts it for you.
You can make a new String out of a char or chars
so:
Code: Select all
Dim br As BinaryReader = new BinaryReader(new FileStream(file))
Dim c As char = br.ReadChar()
Dim s As String = new String(c)
You could try just sending the char into the textbox.Text, maybe vb converts it for you.