Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Converting Variables to byte arrays


Converting Variables to byte arrays

Author
Message
Perrie
Perrie
Forum God
Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)

Group: Forum Members
Posts: 13, Visits: 308
Ive just discovered winsock doesnt like User Defined types so I figure it will be easier to convert the entire block of data into a byte array, send that and then convert back into its components in the type at the other end.

Bytes and strings are easy to do but I cant seem to find any reference as to how integers, long integers, singles and doubles are assembled except for how many bytes long they are.

I know that 1 bit is used to determine if the value is positive or negative but is it the most or least significant bit and in what order are the bytes stored to create the value.

Perrie
Perrie
Forum God
Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)Forum God (3.8K reputation)

Group: Forum Members
Posts: 13, Visits: 308
Dont worry I found a workaround for this one.

Create a second User Defined Type of a single byte array with more elements than any of the types I have created

Use Lset to push my defined type into the byte array

Use a loop to cycle the individual bytes out of the defined array into a normal Byte array

send that byte array through winsock

do same procedure in reverse at the recieving end

jacketsodaly
jacketsodaly
Forum God
Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)Forum God (678 reputation)

Group: Forum Members
Posts: 2, Visits: 1
Dont worry I found a workaround for this one.



Create a second User Defined Type of a single byte array with more elements than any of the types I have created



Use Lset to push my defined type into the byte array



Use a loop to cycle the individual bytes out of the defined array into a normal Byte array



send that byte array through winsock



do same procedure in reverse at the recieving end

I agree with you, thanks!























-----------------------------------------------------------------------------------------------------------------

party dresses|flower girl dresses|trumpet wedding dresses

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search