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
4
Medium Priority
?
210 Views
Last Modified: 2010-04-30
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
Comment
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
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

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

1234h (h for hexadecimal)

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

by:
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

by:martinnetquote
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

by:martinnetquote
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question