Results 1 to 9 of 9

Thread: [RESOLVED] String Array

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    208

    Resolved [RESOLVED] String Array

    vb Code:
    1. Dim Out() As String
    2. Out() = Split(File, "\/\/")

    Out(1) now contains the data i want, I want to put Out(1) into an Array()

    vb Code:
    1. Dim Out() As String
    2. Dim EFile() As String
    3. Out() = Split(File, "\/\/")
    4. EFile() = Out(1) '<- I need to know how to do this (o.o)

  2. #2

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

    Re: String Array

    When Out() returned from Split() is became a populated array in itself. Are you saying that Out(1) has delimited data that you want to put in yet another array? If so... EFile() = Split(Out(1), [delimiter]). Supply the delimiter
    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}

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: String Array

    Each element in array of strings is simply a String unless instructed otherwise.
    In your case it is a string so EFile should not be defined as array:
    Code:
    Private Sub Command1_Click()
    Dim Out() As String
    Dim EFile As String
    
        Out() = Split("abc\/\/123", "\/\/")
        EFile = Out(1)
        
        Debug.Print EFile 'it should contain "123"
    
    End Sub

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    208

    Re: String Array

    ehmm... is their a StringToByteArray function?

  6. #6

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

    Re: String Array

    Try: EFile() = StrConv(Out(1), vbFromUnicode)

    Edited: Definitely answer MartinLiss' question, so we can stop guessing.
    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}

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    208

    Re: String Array

    Im writing an encryptor. It its using strings etc... i want to make the encryption now using Xor but things arn't going to plan as i doubt you can Xor a string and turn it into a Byte Array?

    Is their a way to convert a string into a byte then back from byte to string?

    Maby just Xor the string and then convert to byte?
    Last edited by Gunner54; Mar 9th, 2008 at 05:30 PM.

  9. #9
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: [RESOLVED] String Array

    Look at Lavolpe's post, use the StrConv() function.

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