Results 1 to 3 of 3

Thread: [RESOLVED] convertion to string

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2015
    Posts
    102

    Resolved [RESOLVED] convertion to string

    anyone spare a function to convert somthing like this to a string
    Code:
    Array(
    Last edited by newbiedoobie1983; May 21st, 2020 at 04:44 PM.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: convertion to string

    Code:
    Dim n as Long, v as Variant, sResult As String
    v = Array( &H17, &H19, &H6E, &H6E, &H65, &H72, &H20, &H77, &H61, &H73, &H20, &H61, &H20, &H62, &H69, &H67, _
          &H20, &H66, &H61, &H74, &H20, &H68, &H6F, &H72, &H73, &H65, &H2C, &H20, &H61, &H20, &H62, &H69, _
          &H67, &H20, &H66, &H61, &H74, &H20, &H68, &H6F, &H72, &H73, &H65, &H20, &H77, &H61, &H73, &H20)
    For n = 0 To UBound(v)
    .. build/concatenate sResult  for each v(n) -- can't do it all for you, gotta let you have a bit of fun ;)
    Next
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: convertion to string

    you could try like

    Code:
    For i = 0 To UBound(a)
        s = s & "&H" & Hex(a(i)) & ","
    Next
    where a is the array as above and s is the string returned, change to suit format and delimiter
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width