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

x
?
Solved

Converting byte array to String

Posted on 2001-06-13
4
Medium Priority
?
325 Views
Last Modified: 2010-05-02
I have a byte array that represents a string.  How do I convert it to a variable length String
0
Comment
Question by:c095276
[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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6185955
you can simply assign it to a string variable.

dim bytArray() as byte
dim strData as string

'i assume that the bytArray variable is actually filled with data...

strData = bytArray

Cheers
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 80 total points
ID: 6186055
Dim b() as Byte, Str as string

...

Str = StrConv(b, vbUniCode)

0
 
LVL 15

Expert Comment

by:ameba
ID: 6186150
It depends on what is in your byte array:

Private Sub Form_Click()
    Dim bytArray() As Byte
    Dim strData As String
   
    strData = "AAA"
    bytArray = StrConv(strData, vbFromUnicode)
    MsgBox "UBound(bytArray) = " & UBound(bytArray)
    strData = StrConv(bytArray, vbUnicode)
    MsgBox strData
   
    strData = "AAA"
    bytArray = strData
    MsgBox "UBound(bytArray) = " & UBound(bytArray)
    strData = bytArray
    MsgBox strData
End Sub
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6186312
Glad to be of service!

regards,
CJ
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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 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