Results 1 to 5 of 5

Thread: Trouble with Split function!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Trouble with Split function!

    I get an error message "Expected Array".
    VB Code:
    1. dim temp as string
    2. temp = Split(filename, " - ")
    3.  
    4.    
    5.     temp(0) = artist
    6.     temp(1) = Songname

  2. #2
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375

    Re: Trouble with Split function!

    Originally posted by hipopony66
    VB Code:
    1. dim temp as string
    Change that to:
    VB Code:
    1. dim temp() as string
    You just proved that sig advertisements work.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    It's because you declared temp as a string instead of an array of strings:
    VB Code:
    1. dim temp as string
    2. 'should be this
    3. dim temp() as string

    Or you could make it a variant but that is not needed.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well it looks like I'm not the quickest draw in the west.

  5. #5
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    I won...theres a first
    You just proved that sig advertisements work.

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