Small Question May i have your help ?

07/19/2012 22:13 badguy4you#1
i want to perform some check on my program start up but the problem is not that i cant create the checks ... i will explain below

in Form1 Load property i created those checks lets say

public void Check1()
{
//here i want to return a value
}

public void Check2()
{
//here i want to return another value
}

public void Check3()
{
//here i want to return a third value
}

so in Form1.Load i want to do the following

Check1();
Check2();
Check3();

but as a sequence so Check2 is not fired until the value returned from Check1 is true and Check3 is not fired until the value returned from Check2 is true

and if false in one of them the program loading stops

Please idk what to do so i decided to ask you guys cuz i am pretty sure i will not get benefit in any other place but here @ EPVP
07/20/2012 01:04 MoepMeep#2
Using void, wanting to return something. Your question is the biggest bullshit I read this week. You know NOTHING about programming and you will never know anything. You keep asking simple stuff, which is explained in every book within the first chapters. Just quit it.
07/20/2012 01:07 badguy4you#3
Quote:
Originally Posted by MoepMeep View Post
Using void, wanting to return something. Your question is the biggest bullshit I read this week. You know NOTHING about programming and you will never know anything. You keep asking simple stuff, which is explained in every book within the first chapters. Just quit it.
And i kept telling you if you fcken want to increase your posts with just bull shits like that dont fcken replay to my threads ... second i posted my code not to want to return a value from void but to show what i am doing and give a full review of what i want to do


Again u are not welcomed in my threads anymore
07/20/2012 13:28 Jeoni#4
Ok, I want to help. But I have to say that MoepMeep is right, also I wouldn't express it like that. The solution to this problem are return values and if-questions, which are explained in the first chapters.
Code:
public bool Check1() // returns true on success, false otherwise
{ 
//your code (you know how to return a value?)
}
All Check-Functions are like that and in Form Load:
Code:
if (Check1() == false)
{
Application.exit();
}

if (Check2() == false)
{
Application.exit();
}

if (Check3() == false)
{
Application.exit();
}

// I think that's not the best way, but it should work
I would highly recommend to buy a book and learn something from there. If you have a real problem that is not explained in the first chapters of a standart programming book, you can ask it here. I think that is what MoepMeep wanted to say that :D
I hope that I helped ;)
Jeoni

P.S.: Next time put your code in the Code-Tags please.
07/20/2012 16:48 badguy4you#5
Quote:
Originally Posted by Jeoni View Post
Ok, I want to help. But I have to say that MoepMeep is right, also I wouldn't express it like that. The solution to this problem are return values and if-questions, which are explained in the first chapters.
Code:
public bool Check1() // returns true on success, false otherwise
{ 
//your code (you know how to return a value?)
}
All Check-Functions are like that and in Form Load:
Code:
if (Check1() == false)
{
Application.exit();
}

if (Check2() == false)
{
Application.exit();
}

if (Check3() == false)
{
Application.exit();
}

// I think that's not the best way, but it should work
I would highly recommend to buy a book and learn something from there. If you have a real problem that is not explained in the first chapters of a standart programming book, you can ask it here. I think that is what MoepMeep wanted to say that :D
I hope that I helped ;)
Jeoni

P.S.: Next time put your code in the Code-Tags please.
And i really appreciate your HELP\Constructive Criticism...

But really i hate the way MoepMeep speaking with i hate Destructive Criticism . Every time he replays to any post he says quite programing balablabla

But i didnt explained the point i want to achieve well i want them to be a sequence so the second IF did not fire until the first is finished
07/20/2012 17:24 kissein#6
u can shorten that code but anyways its not a good programming style.

Code:
if(check1() || check2() || check3())
	Application.Exit()
else
	//proceed
@badgay4you either u dont know the basics very well and as a result you are lacking experience or your thinking is to complex. lets try to keep it simple as possible ;)
07/20/2012 18:50 MoepMeep#7
Quote:
Originally Posted by badguy4you View Post
But i didnt explained the point i want to achieve well i want them to be a sequence so the second IF did not fire until the first is finished
Either you can't express what you want to archieve or thats worth a quote on the forbidden site ;o

Code:
Check1();
Check2();
Check3();
Check2 won't be called till Check1 is done and Check3 won't be called till Check2 is done.

@kissein Would require to return false if the check was successfull, kinda confusing, isn't it?

Code:
if(!check1() || !check2() || !check3())
	Application.Exit()
Code:
if(!(check1() & check2() & check3()))
       Application.Exit()
I hope you know the difference between && and &.

Quote:
But really i hate the way MoepMeep speaking with i hate Destructive Criticism . Every time he replays to any post he says quite programing balablabla
Sorry if truth hurts your feelings(yes smith, irony).


@Jeoni
Code:
if (Check1() == false)
F, repeat class please.
07/20/2012 19:27 kissein#8
as i said, "bad programming style" but it would fit for his explanation logic.
07/20/2012 20:29 badguy4you#9
Quote:
Originally Posted by MoepMeep View Post
Sorry if truth hurts your feelings(yes smith, irony).
You dont know that there is something called Constructive&Destructive Criticism ?! u only use the Destructive why dont you tell me what i should learn instead of just shouting and saying QUIT QUIT QUIT !? and tell me "if truth hearts" i am sure that no one has started programming with 100% skills ! . its my first month of programming and i can achieve alot of things now ofc there is alot of things i still be missing but its not that BAD

And in the last post i was asking how could i separate my project in multiple classes so i make a class for every method but use them from the main class and instead of giving me some useful help u also entered and just told me to QUIT ... and my problem is not solved yet cuz using
Code:
MyClass MC = new MyClass();
is just creating a new instance of the class i want to use the class as if the codes in it were in my main class