|
-
Feb 18th, 2019, 04:15 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] CopyMemory a range of integer array values to create a string?
I have an integer array containing character codes. I want to create a string from a range of these character codes. I know that I can do this by concatenating the Chr$() of each character code, But I'm wondering if this can be done faster and in one go using CopyMemory. Everything I try either crashes or doesn't work.
Ex.
Dim arrCharCodes(1 to 5) as Integer
arrCharCodes(1) = 65 'A
arrCharCodes(2) = 66 'B
arrCharCodes(3) = 67 'C
arrCharCodes(4) = 68 'D
arrCharCodes(5) = 69 'E
dim strCharCodes as String
strCharCodes = Chr$(arrCharCodes(2)) & Chr$(arrCharCodes(3)) & Chr$(arrCharCodes(4))
'results in strCharCodes = "BCD"
Can this be achieved faster using CopyMemory to copy a range of values from the Integer array into a string variable? If so, how?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|