|
Read the documentation!
Read the error message!
Look at your code!
This isn't complex: even without seeing the actual error message it's pretty obvious that it's going to be several error messages:
"Text is a property, but is used like a method",
"No overload for method 'getLEBridgeNumber' takes 1 arguments"
"No overload for method 'ToInt32' takes 3 arguments"
"Non-invocable member 'System.Windows.Forms.Control.Text' cannot be used like a method"
Maybe more, depending on your spelling! :laugh
Now look at the line:
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome,Text, Convert.ToInt32(Expression_outcome.Text())));
Let's have a look at some of the bits you have here:
Expression_outcome.Text() Text is a property, not a method - so you can't call it. Get rid of the "()" after it!
That gets rid of a few errors on it's own...
Now look at what else you have, and I'll rip out bits to make it more obvious:
string s = MyMethod(Convert.ToInt32(stringA,stringB, Convert.ToInt32(stringC)));
Why are you trying to call the same method - Convert.ToInt32 - twice with different number of parameters? The first call has three, the second has one. The second is correct - the method does not have an overload that accepts three parameters - and that is exactly what one of your error messages is telling you. It even uses those exact words!
And your method almost certainly is expecting three parameters, not one!
So sort out your brackets:
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome), Text, Convert.ToInt32(Expression_outcome.Text));
wilcoten wrote: programming has to be fun, even the learning proggress.
Yes, it does: but that means you have to think about what you are doing, not just randomly throw stuff together and hope it works!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
modified 30-Apr-16 10:24am.
|
|
|
|
|
Thanks for the explanation in detail, but it still don't work for me, and I'm getting feeling very stupid. I can follow your thinking and take the same staps as you advise,I think.
I still get the error that it } Expect.
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome, Text, Convert.ToInt32(Expression_outcome.Text));
This is the only error that is left
I appriciate if you will help me again, so I can further.
|
|
|
|
|
Is there any point in me typing here, if you are going to ignore what I said?
Look at your code in the post above, and the line I gave you in the post above that...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I don't wanna opset you, I realy don't get it. I read your post and see the staps you take.
This is the code where the outcome must be visible in a textbox:
}
//L/E Number (LifePath/Expression Bridge Number).
public static number getLEBridgeNumber(int lifePathNumber, int expressionNumber)
{
//Next we count each of the resulting digits (or Master numbers) together and reduce the total again to a single-digit.
return new number(lifePathNumber - expressionNumber);
}
If you will be so kind to write the right code, I don't have to border you with this, I learned something, and we are both ok, I hope.
|
|
|
|
|
To be explicit about this...
Try:
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome.Text), Convert.ToInt32(Expression_outcome.Text));
I'm not upset, I'm just a little depressed that you apparently read what I said and then didn't even try to apply it to your code. This isn't complex stuff - this is pretty trivial, and if you don't learn how to deal with problems at an early stage, then the complex stuff is going to really confuse you and you may give up completely.
I get the feeling that you are trying too hard to run before you can walk!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I did, but it didn't work out.
}
//L/E Number (LifePath/Expression Bridge Number).
public static number getLEBridgeNumber(int lifePathNumber, int expressionNumber)
{
//Next we count each of the resulting digits (or Master numbers) together and reduce the total again to a single-digit.
return new number(lifePathNumber - expressionNumber);
}
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome.Text), Convert.ToInt32(Expression_outcome.Text));
When I put the code you wrote in your last post, I got this error:
Error 1 Cannot implicitly convert type 'number' to 'string'
Actualy I'm a good runner LOL, It is not the case that I don't wanna learn, but before you are 8 it is best that you can walk LOL
|
|
|
|
|
Well we both know what part is a string !
So what part do you think is a "number "?
At a guess, it's your getLEBridgeNumber method - which you haven't shown us - that returns an instance of a class called number - which you haven't shown us - which might (or might not) have a useful ToString implementation, or might have a property you want to use. But I can't tell any of that, because I don't have access to your class!
See what I mean by thinking instead of throwing it together and hoping?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I know wat you are saying, it is for me also hard to change the code of someone else, because I can't read his mind, when he set up this part of the software.
I think I have the information for you that is missing. And you are right, this is not stuf for a beginner, but I had to start from here, to get it working I hope you appriciate my effort for this.
This is the missing code, together with the part in the last post it is all clear for you I hope.
// nummerpaar
public class number
{
private int _n; // niet-vereenvoudigd nummer
private int _nSimple;
public number(int n)
{
_n = n;
_nSimple = numService.simplify(n);
}
public int simplifiedNumber
{
get
{
return _nSimple;
}
}
public int n
{
get
{
return _n;
}
}
public override string ToString()
{
return _n == _nSimple ? _n.ToString() : _n.ToString() + '/' + _nSimple.ToString();
}
}
abstract class numService
{
private static List<char> vowels = new List<char> { 'a', 'e', 'i', 'o', 'u' };
|
|
|
|
|
So your number class supports ToString... so all you have to do is call it on the returned value from your method!
LE_bridge_outcome.Text = numService.getLEBridgeNumber( ... ).ToString();
Seriously, you need to know the basics well before you start on complex stuff...you'll only confuse yourself more if you don't.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
If you double-click on the error it will normally take you to the line with the problem. As for #1, you have namespace written twice. Just need it once.
As for #2, double-click the error and it will take you to the line of the problem and it says you are missing a }.
What sometimes happens is you fix one error (for example this namespace one) and many others actually go away because it was causing other errors to appear.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks again, The errors are resolved, only the warning is still there.
Another thing, when I got two text boxes with an outcome, and I like to show another outcome in text box 3, how can I do that for this code?
//L/E Number (LifePath/Expression Bridge Number).
public static number getLEBridgeNumber(int lifePathNumber, int expressionNumber)
{
//Next we count each of the resulting digits (or Master numbers) together and reduce the total again to a single-digit.
return new number(lifePathNumber - expressionNumber);
}
When I try this it doesn't workL
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Life_path_outcome.Text, Expression_outcome.Text).ToString();
|
|
|
|
|
wilcoten wrote: I like to show another outcome in text box 3, how can I do that for this code? Putting something into a textbox is very, very easy. TextBoxID.Text = whateveryouwant.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I know that, I did it for other outcomes of calculations, but with this example it doesn't work for me in the same way, but I don't know what I'm doing wrong.
|
|
|
|
|
wilcoten wrote: but with this example it doesn't work for me in the same way, We can't run your code so you need to debug it to see why it isn't doing what you want. Put a breakpoint and then step through line by line and examine your variables and controls. Debugging is very powerful.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I agree, I got this error:
Error 1 Argument 1: cannot convert from string to int"
Any suggestions for this situation?
|
|
|
|
|
wilcoten wrote: Argument 1: cannot convert from string to int"
Any suggestions for this situation? Yes, take a deep breath and slow down. Just read the error. It says you cannot convert a string to an int. And it tells you argument 1.
So, look at your function getLEBridgeNumber. It is declared to take an integer as the first argument. However, you passed in Life_path_outcome.Text and the Text property of the control is a string. So, you need to convert the string to an integer. An easy way is to simple do Convert.ToInt32(Life_path_outcome.Text). That converts whatever is in the textbox to an integer. You really want to check your input because this will fail if someone does not type a number in the textbox but for now this should work for you.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I follow your advise with this code:
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome,Text, Convert.ToInt32(Expression_outcome.Text());
This is the error:
) Expected
|
|
|
|
|
You opened four parenthesis but only closed two. You need to add two more close parenthesis at the end, right before the semicolon.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Maybe I'm dumb because I am a newby and can't fix this.
When I use for at the end as you suggest I get this errors:
Error 1 No overload for method;getLEBridgeNumber takes 1 arguments
Error 2 No overload for method ToInt32 takes 3 arguments
Error 3 System.Windows.Forms.TextBox.Tex is a propert but is used like a method
Error 4 Non-invocable member System.Windows.Forms.Control.Text cannot be used like a method.
I realy wanna learn, and I know this is not easy, but is it realy so hard, this simple code?
Thanks for your patient, Wilco
|
|
|
|
|
This is the code with the errors in the last post:
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome,Text, Convert.ToInt32(Expression_outcome.Text())));
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome,Text, Convert.ToInt32(Expression_outcome.Text)))();
It doesn't matter how I do it, the result is overload or ) Expected.
This is now very frustrating, so If you will write the right code for me, will be fine.
Programming has to be fun, even the learning proggress. It would be nice if this work before I go to bed, it is for me now 00:15
|
|
|
|
|
wilcoten wrote: ) Expected Yes, it is expected. I am glad to help and I know you are a beginner but you really have to start understanding what the compiler is telling you. You didn't close the Convert.ToInt32()
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
This is the code with the errors in the last post:
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome,Text, Convert.ToInt32(Expression_outcome.Text())));
LE_bridge_outcome.Text = numService.getLEBridgeNumber(Convert.ToInt32(Life_path_outcome,Text, Convert.ToInt32(Expression_outcome.Text)))();
It doesn't matter how I do it, the result is overload or ) Expected.
This is now very frustrating, so If you will write the right code for me, will be fine.
Programming has to be fun, even the learning proggress. It would be nice if this work before I go to bed, it is for me now 00:15
|
|
|
|
|
I see the issue. You didn't close the first Convert.ToInt32 method call.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Thank you for the private email.
No, this is a public forum, and private answers do not help others - which is the whole idea.
Plus, I receive several hundred emails every day, and don't need any more!
"The error appears when I build/start the program in visual studio."
Which means it's a a compilation error - the compiler doesn't like what you wrote.
Look at the "Error List" pane, and double click on the first error. It will take you directly to the line that it thinks you got wrong.
Look at the error message and it's normally pretty obvious what you did, but if you can;t work it out, copy and paste the error message and the line that caused it (plus half a dozen lines either side for context) and post them in a reply. Don't give us pictures, we can't try compiling a picture if we can't work it out ourselves, and don't want to type it all in!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
And that's why I have email switched off.
This space for rent
|
|
|
|
|