Operator '&' is not defined...?

Discussion in 'Programming General' started by megajosh2, Apr 20, 2008.

Operator '&' is not defined...?
  1. Unread #1 - Apr 20, 2008 at 2:04 PM
  2. megajosh2
    Joined:
    Apr 18, 2008
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0

    megajosh2 Member

    Operator '&' is not defined...?

    I got this code in my vb file:
    Code:
            [COLOR="Blue"]Do While[/COLOR] i < 25
                ListBox1.Items.Add([U]SkillName(i) & [COLOR="Red"]": "[/COLOR] & SkillData[/U])
                i = i + 1
            [COLOR="Blue"]Loop[/COLOR]
    
    The underlined code is underlined blue in VB2008 and the error message is:
    Code:
    Operator '&' is not defined for types 'String' and '1-dimensional array of String
    I don't know if maybe it has something to do with this:

    Code:
    [COLOR="Blue"]Dim[/COLOR] SkillInfo = Split(Data, [COLOR="Red"]" "[/COLOR])
    or this (all the code references are higher than each other in the script):
    Code:
    
    [code]Data = Web.DownloadString("[U][COLOR="Red"]http://hiscore.runescape.com/index_lite.ws?player=" & userName)[/COLOR][/U]
     
  3. Unread #2 - Apr 22, 2008 at 10:42 AM
  4. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Operator '&' is not defined...?

    Code:
    Dim SkillInfo = Split(Data, " ")
    You should set it to a string you havn't classed it as anything.

    Code:
    Dim SkillInfo as string = Split(Data, " ")[code]
    
    also SkillName(i) and SkillData, How are they generated?
     
  5. Unread #3 - Apr 22, 2008 at 5:01 PM
  6. megajosh2
    Joined:
    Apr 18, 2008
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0

    megajosh2 Member

    Operator '&' is not defined...?

    They're generated as part of SkillInfo ultimately. Thanks, I'll set it As String.
     
  7. Unread #4 - Apr 22, 2008 at 5:13 PM
  8. megajosh2
    Joined:
    Apr 18, 2008
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0

    megajosh2 Member

    Operator '&' is not defined...?

    Didn't work. Ultimately, what I wanted to be a string had to be a string array. I just used (0) from it.
     
  9. Unread #5 - Apr 22, 2008 at 7:27 PM
  10. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Operator '&' is not defined...?

    Does SkillName(i) have any additional properties?

    If so maybe either name or if that fails try anding .tostring onto it see if that does any good.
     
< New to VB6 | Need Help? Ask Me >

Users viewing this thread
1 guest


 
 
Adblock breaks this site