Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2012, 06:40 PM   PM User | #1
coxmg
New Coder

 
Join Date: Sep 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
coxmg is an unknown quantity at this point
Operator Cannot be applied to operand

private double avgdailyprice = 1;

Print("Show this: " && avgdailyprice);
coxmg is offline   Reply With Quote
Old 11-05-2012, 07:23 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
What language; C#? && is the and operator, you cannot concat with that. Use + for string concatenation. I don't think the && exists in VB.NET; the & would be concat. Although I think that + is overloaded to work with strings in VB.NET as well, but I cannot recall.
Fou-Lu is offline   Reply With Quote
Old 11-05-2012, 08:48 PM   PM User | #3
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
def not C# or VB

'Print' as it relates to the context is not a valid C# or VB method
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Old 11-05-2012, 09:21 PM   PM User | #4
coxmg
New Coder

 
Join Date: Sep 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
coxmg is an unknown quantity at this point
its C#, thanks, the + worked.
coxmg is offline   Reply With Quote
Old 11-05-2012, 09:43 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by alykins View Post
def not C# or VB

'Print' as it relates to the context is not a valid C# or VB method
Oh yeah good call. That'd be writeline in C#. Java could use print, but only off of a statically imported java.lang.System.out, and would still need out.print called on it.
Perhaps a custom method in place here.
Fou-Lu is offline   Reply With Quote
Old 11-07-2012, 07:22 PM   PM User | #6
sajjadaslam3
New to the CF scene

 
Join Date: Nov 2012
Location: Islamabad
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sajjadaslam3 is an unknown quantity at this point
You should write + sign for concatenation in C# like console.WriteLine("hello"+"World");
sajjadaslam3 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:24 AM.


Advertisement
Log in to turn off these ads.