Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Classic Visual Basic (VB 6 or earlier) » General Visual Basic » Converting Variables to byte arrays


Converting Variables to byte arraysExpand / Collapse
Author
Message
Posted 5/31/2011 6:58:39 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 11/19/2011 12:08:16 PM
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.

Post #30407
Posted 5/31/2011 8:25:31 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 11/19/2011 12:08:16 PM
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

Post #30408
Posted 1/16/2012 9:54:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/16/2012 9:50:11 PM
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
Post #31156
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod, Mark, Keithuk

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 2:15am