Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Big edian

Posted on 1999-07-28
Medium Priority
210 Views
I need to convert a string length into a 4 byte unsigned integer. The 4 byte field must be in big endian byte formatting. Need to do it in VB.
Many thanks
0
Question by:martinnetquote
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 10

Expert Comment

ID: 1528135
you mean if the length of a string was

you want it to be stored like this in a long variable??

3412 ?? or 4321?!

Sorry, i'm kinda confused here..

..-=ViKtOr=-..
0

LVL 18

Accepted Solution

deighton earned 600 total points
ID: 1528136
Public Function bin(x As String) As String

Dim d As Double
Dim i As Integer

d = Val(x)

While Abs(d) > 0.5

i = CInt(d - 2 * Int(d / 2))
bin = CStr(i) & bin
d = Int(d / 2)

Wend

If bin = "" Then bin = "0"

End Function

0

Author Comment

ID: 1528137
Thanks deighton, however could you please have a look at this
question
at

http://www.universalstore.com.au/endian/bigendian.jpg
(scanned image)

thanks.
0

Author Comment

ID: 1528138
Thanks deighton, however could you please have a look at this
question
at

http://www.universalstore.com.au/endian/bigendian.jpg
(scanned image)

thanks.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
###### Suggested Courses
Course of the Month4 days, 15 hours left to enroll