Click here to Skip to main content
14,970,700 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
error code cs0131 the left hand side of the assignment must be a variable, property or indexer

the code is in C#
the code line is as follows

SendIrcMessage(":" + userName + "!" + userName = "@" + userName + ".tmi.twitch.tv PRIVMSG #" + " :" + message);

What I have tried:

I havnt tried anything yet as I am new to coding
Posted
Updated 24-Oct-17 12:26pm

1 solution

The error is because of your "=" sign, maybe it should be a "+" or surrounded by quotes.

If it is supposed to be included in the text (ie; You want the your message to be;
":FredS!FredS=@FredS.tmi.twitch.tv PRIVMSG#:The message that I want to send is blah")
Then you need to include quotes around the "=" sign. Change your code to the below;
C#
SendIrcMessage(":" + userName + "!" + userName + "=@" + userName + ".tmi.twitch.tv PRIVMSG #:" + message);

The way you have written it you are trying to assign the value
C#
"@" + userName + ".tmi.twitch.tv PRIVMSG #:" + message

to
C#
":" + userName + "!" + userName


Kind Regards
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900