Click here to Skip to main content
16,005,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: can we use .net dlls in win32 applicatiuons Pin
Dave Kreskowiak9-Jan-06 3:21
mveDave Kreskowiak9-Jan-06 3:21 
GeneralRe: can we use .net dlls in win32 applicatiuons Pin
abyclassic10-Jan-06 19:07
abyclassic10-Jan-06 19:07 
GeneralRe: can we use .net dlls in win32 applicatiuons Pin
Dave Kreskowiak11-Jan-06 1:05
mveDave Kreskowiak11-Jan-06 1:05 
QuestionRun other applications within my application Pin
AesopTurtle8-Jan-06 14:19
AesopTurtle8-Jan-06 14:19 
AnswerRe: Run other applications within my application Pin
Dave Kreskowiak8-Jan-06 15:44
mveDave Kreskowiak8-Jan-06 15:44 
QuestionMetaFIle Pin
felopater8-Jan-06 14:08
felopater8-Jan-06 14:08 
AnswerRe: MetaFIle Pin
leppie8-Jan-06 18:49
leppie8-Jan-06 18:49 
QuestionCreating logical string Pin
Guinness4Strength8-Jan-06 14:00
Guinness4Strength8-Jan-06 14:00 
I'm not sure how to solve this problem and I'm hoping someone can help. I'm writing an application that allows the user to configure logical operations using IF,THEN,AND,OR operators, but I'm a bit confused as to the best way to evaluate the conditional statement once it is built. For examples lets say that the user specifies a three part conditional statement and I have evaluated each part and stored the correct boolean value in an ArrayList. How do I evaluate all the parts of the condition at once ?

ArrayList Parts = new ArrayList();
//Add values for testing
Parts.Add(false);
Parts.Add(false);
Parts.Add(true);
bool Result=false;
//this assumes the OR operator is used false || false || true = true
for(int x=0;x<Parts.Count;x++)
{
	bool Part = (bool)Parts[x];
	if(x==0)
		Result=Part;
	else
	{
		Result=Result || Part;
		if(!Result)
			break;
	}
}
Debug.WriteLine(Result.ToString());


If I evaluate the array in groups of two, the condition is incorrectly false when comparing the first two values (false || false).

What's the best way to evaluate user defined conditional statements ?
Remeber there can be X number of conditionals and both the || and && logical operators can be used.
Thanks for taking the time to read this lengthy message....
AnswerRe: Creating logical string Pin
Colin Angus Mackay8-Jan-06 14:28
Colin Angus Mackay8-Jan-06 14:28 
AnswerRe: Creating logical string Pin
Guinness4Strength8-Jan-06 14:56
Guinness4Strength8-Jan-06 14:56 
Questionget screen coordinate Pin
Sasuko8-Jan-06 13:44
Sasuko8-Jan-06 13:44 
AnswerRe: get screen coordinate Pin
Sasuko8-Jan-06 14:01
Sasuko8-Jan-06 14:01 
GeneralRe: get screen coordinate Pin
krieg388-Jan-06 21:10
krieg388-Jan-06 21:10 
Questioncreating a dialog that acts like a message box Pin
tmp08-Jan-06 12:29
tmp08-Jan-06 12:29 
AnswerRe: creating a dialog that acts like a message box Pin
Christian Graus8-Jan-06 12:38
protectorChristian Graus8-Jan-06 12:38 
GeneralRe: creating a dialog that acts like a message box Pin
tmp09-Jan-06 4:17
tmp09-Jan-06 4:17 
QuestionLossless jpg Pin
Christian Graus8-Jan-06 11:30
protectorChristian Graus8-Jan-06 11:30 
AnswerRe: Lossless jpg Pin
Colin Angus Mackay8-Jan-06 14:05
Colin Angus Mackay8-Jan-06 14:05 
GeneralRe: Lossless jpg Pin
Christian Graus8-Jan-06 14:12
protectorChristian Graus8-Jan-06 14:12 
GeneralRe: Lossless jpg Pin
Colin Angus Mackay8-Jan-06 14:32
Colin Angus Mackay8-Jan-06 14:32 
GeneralRe: Lossless jpg Pin
Christian Graus8-Jan-06 14:36
protectorChristian Graus8-Jan-06 14:36 
GeneralRe: Lossless jpg Pin
peterchen9-Jan-06 3:11
peterchen9-Jan-06 3:11 
GeneralRe: Lossless jpg Pin
Christian Graus9-Jan-06 11:07
protectorChristian Graus9-Jan-06 11:07 
AnswerRe: Lossless jpg Pin
leppie9-Jan-06 1:00
leppie9-Jan-06 1:00 
GeneralRe: Lossless jpg Pin
Christian Graus9-Jan-06 11:06
protectorChristian Graus9-Jan-06 11:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.