Dumb newbie problem with String literals

N

NewBie

Hello all,

Please forgive if this is dumb but I have a deadline to meet.

I have a function func_name(int num, String ip_s1, String ip_s2)

It works just fine if I do

somaclass.func_name(123,"string1","string2");

but not for
someclass.func_name(123,string_var,string_var2);
even though the function "receives" the input correctly.

I have no clue as to what to do. Please help !
 
A

Andrew Thompson

NewBie wrote:
...
Please forgive if this is dumb but I have a deadline to meet.

People who you pay a lot of money, might
care about your deadlines.
I have no clue as to what to do. Please help !

You might ..
- send me a crystal ball so that I might ascertain
(or, you might fill in the details)..
- what you expect 'func_name' to do
- what it actually does do
- the code for 'func_name'.
- ..for extra chance of getting help,
- an SSCCE*

* <http://www.physci.org/codes/sscce/>

If it is 'too urgent' for you to consider the
above, I suggest you hire a consultant.

Andrew T.
 
M

Mark Rafn

NewBie said:
Please forgive if this is dumb but I have a deadline to meet.

It's easy to forgive a dumb question, it's harder to forgive the bizarre
belief that your deadline has anything to do with us. But I'll try :)
I have a function func_name(int num, String ip_s1, String ip_s2)
It works just fine if I do
somaclass.func_name(123,"string1","string2");
but not for
someclass.func_name(123,string_var,string_var2);
even though the function "receives" the input correctly.

This isn't a question, so it can't be a dumb question. It's a statement. And
not a useful one - Why do you think we want to guess what "works just fine"
means, what the function does, and what goes wrong when using a variable
rather than a constant? More importantly, why do you think anyone would be
ABLE to give any useful comment based on so little information.
 
S

Simon Brooke

NewBie said:
Hello all,

Please forgive if this is dumb but I have a deadline to meet.

I have a function func_name(int num, String ip_s1, String ip_s2)

It works just fine if I do

somaclass.func_name(123,"string1","string2");

but not for
someclass.func_name(123,string_var,string_var2);
even though the function "receives" the input correctly.

I have no clue as to what to do. Please help !

Are you using Java? The reason I ask is that, while many Java methods are
technically functions, they're never called that in Java documentation. It
looks to me as though you're using JavaScript, which is a completely
different language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top