Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 18:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Small Question May i have your help ?

Discussion on Small Question May i have your help ? within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
Small Question May i have your help ?

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
badguy4you is offline  
Thanks
1 User
Old 07/20/2012, 01:04   #2
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,426
Received Thanks: 1,888
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.
MoepMeep is offline  
Thanks
3 Users
Old 07/20/2012, 01:07   #3
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
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 ***** 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
badguy4you is offline  
Thanks
3 Users
Old 07/20/2012, 13:28   #4


 
Jeoni's Avatar
 
elite*gold: 966
Join Date: Apr 2010
Posts: 1,104
Received Thanks: 681
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
I hope that I helped
Jeoni

P.S.: Next time put your code in the Code-Tags please.
Jeoni is offline  
Thanks
1 User
Old 07/20/2012, 16:48   #5
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
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
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
badguy4you is offline  
Old 07/20/2012, 17:24   #6
 
kissein's Avatar
 
elite*gold: 0
Join Date: Sep 2005
Posts: 426
Received Thanks: 87
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
kissein is offline  
Old 07/20/2012, 18:50   #7
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,426
Received Thanks: 1,888
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.
MoepMeep is offline  
Old 07/20/2012, 19:27   #8
 
kissein's Avatar
 
elite*gold: 0
Join Date: Sep 2005
Posts: 426
Received Thanks: 87
as i said, "bad programming style" but it would fit for his explanation logic.
kissein is offline  
Thanks
1 User
Old 07/20/2012, 20:29   #9
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
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
badguy4you is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
small question
11/21/2011 - Ragnarok Online - 0 Replies
hi i play in thadi aro server and i have openkore bot but when i chose the server he say you must Chang the Regional and Language Options to English but i cant Chang it i need any program can change it because i don't have the CD thanks agine :D
just small question
05/14/2011 - CO2 Private Server - 5 Replies
guys just wanna know ... how to use this command @soulitem to get all soul items i tried @soulitem (item name) fixed 0 0 0 0 0 nothing done, and tried @soulitem (item ip)
hy ppl, small question about 12-sky
02/12/2010 - General Gaming Discussion - 3 Replies
Iam not a coder or something but iam think 12-sky must be easy to hack cuzz its have not much player and its rly low skilled ahs use a few auto macros for the game but still not same like a bot or something so i wantet to ask any have any hacks for 12sky? or maybe can give me tipps where i can get it iknow the game looks gay... but its still fun haha :D but with a bot or something it would be much better ;)
a small question :)
05/16/2009 - SRO Private Server - 3 Replies
can anyone tell me a site where i can change my password for SJSRO if so thanks alot :)
Question about bot small.
09/30/2007 - Dekaron - 5 Replies
Hi. I've resently started playing 2moons and I'm allready finding the constant grinding to level up very boring (i'm lvl 56). So a bot would really help out allot. I've read some posts here and on bot small's site and I was wondering if the older version of bot small that is free still works and if it's possible to get it somehow? Maybe someone could upload it here or something? Thanks.



All times are GMT +2. The time now is 18:37.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.