eric
25th February 2008, 18:58
Hi,
I'd like to do something that I have no idea how to do even in c++ but maybe Qt has someting that can help me?
I was wondering how you would set up an "if statement" where the condition is a variable (and whether that is even possible). This is what I mean:
i have:
if(statement1) dosomething1();
if(statement2) dosomething2();
But I want the statements in the "if clause" to come from a user-made text file. For example if user makes a text file like so:
a<b || a>c
a>=b && a<=C
Then the program is going to execute these lines:
if(a<b || a>c) dosomething1()
if(a>=b && a<=C) dosomething2();
Is this even possible and what would be the best way to do it?
Thans a lot.
Eric
I'd like to do something that I have no idea how to do even in c++ but maybe Qt has someting that can help me?
I was wondering how you would set up an "if statement" where the condition is a variable (and whether that is even possible). This is what I mean:
i have:
if(statement1) dosomething1();
if(statement2) dosomething2();
But I want the statements in the "if clause" to come from a user-made text file. For example if user makes a text file like so:
a<b || a>c
a>=b && a<=C
Then the program is going to execute these lines:
if(a<b || a>c) dosomething1()
if(a>=b && a<=C) dosomething2();
Is this even possible and what would be the best way to do it?
Thans a lot.
Eric