Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,081 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,803 people online right now. Registration is fast and FREE... Join Now!




Operator '&' is not defined

 
Reply to this topicStart new topic

Operator '&' is not defined, CLICK HERE Can you help me solve this error? CLICK HERE

megajosh2
20 Apr, 2008 - 01:52 PM
Post #1

New D.I.C Head
*

Joined: 20 Apr, 2008
Posts: 1

I got this code in my vb file:
CODE

        Do While i < 25
            ListBox1.Items.Add(SkillName(i) & ": " & SkillData)
            i = i + 1
        Loop


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
Dim SkillInfo = Split(Data, " ")

or this (all the code references are higher than each other in the script):
CODE
Data = Web.DownloadString("http://hiscore.runescape.com/index_lite.ws?player=" & userName)


This post has been edited by megajosh2: 20 Apr, 2008 - 01:55 PM
User is offlineProfile CardPM
+Quote Post

m2s87
RE: Operator '&' Is Not Defined
20 Apr, 2008 - 07:04 PM
Post #2

D.I.C Regular
Group Icon

Joined: 28 Nov, 2006
Posts: 390



Thanked: 3 times
Dream Kudos: 1225
My Contributions
You can write
vb

Do While i < 25
ListBox1.Items.Add(SkillName(i) & ": " & SkillData)
i = i + 1
Loop

as
vb.net

For x as String in SkillName
ListBox1.Items.Add(x & ": " & SkillData)
Next


User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Operator '&' Is Not Defined
21 Apr, 2008 - 02:29 AM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,032



Thanked: 38 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
You have to pass a string to the Add() function.
What is the data type of SkillData?
It should be a String.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 11:32PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month