Click here to Skip to main content
15,909,605 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: tolerance :o) Pin
kochhar18-Jun-03 12:44
kochhar18-Jun-03 12:44 
GeneralRe: tolerance :o) Pin
Baris Kurtlutepe18-Jun-03 22:50
Baris Kurtlutepe18-Jun-03 22:50 
GeneralRe: tolerance :o) Pin
John M. Drescher19-Jun-03 0:15
John M. Drescher19-Jun-03 0:15 
GeneralShell ComboBox Pin
Nicholas Naddaf18-Jun-03 9:28
Nicholas Naddaf18-Jun-03 9:28 
GeneralRe: Shell ComboBox Pin
valikac18-Jun-03 12:49
valikac18-Jun-03 12:49 
GeneralRe: Shell ComboBox Pin
Nicholas Naddaf19-Jun-03 2:58
Nicholas Naddaf19-Jun-03 2:58 
GeneralTool bar is moving.... Pin
Shay Harel18-Jun-03 9:14
Shay Harel18-Jun-03 9:14 
GeneralC++ Filter Pin
Anton A. Loukine18-Jun-03 9:11
Anton A. Loukine18-Jun-03 9:11 
I am writing a filter for an array of classes. I want users to type in the filtering parameters as text in a script file. E.g.

Price > 10;
Country = "US";
Currency = "CAD";
Years <= 5, etc.

The c++ code should then create an unfiltered array, read this file, and then filter the array. One way of doing this is to come up with a bunch of if statements:

if( sLHS == "Price" )
{
if( sSign == ">" )
if( GetPrice( ) > 10 ) bPassed = true;
else if( sSign == "<" )
if( GetPrice( ) < 10 ) bPassed = true;
...
}
...
if( sLHS == "Years" )
{
if( sSign == ">" )
if( GetYears( ) > 5 ) bPassed = true;
....
}

and so on.

With many parameters to choose from I am going to end up with a thousand of if statements. I AM LOOKING FOR AN EASIER WAY AND I NEED YOUR HELP.

It would be really nice if I could come up with an array of something like this:

Price GetPrice( );
Country GetCountry( );
Years GetYears( ), etc.

then go through the array, find the corresponding item in the left column and then call a specific function in the right column based on its name. BUT HOW CAN I DO THIS AT RUN TIME?

Any thoughts are appreciated.

Thanks
GeneralRe: C++ Filter Pin
act_x18-Jun-03 9:49
act_x18-Jun-03 9:49 
GeneralRe: C++ Filter Pin
Anton A. Loukine18-Jun-03 9:54
Anton A. Loukine18-Jun-03 9:54 
GeneralRe: C++ Filter Pin
Andrew Walker18-Jun-03 16:50
Andrew Walker18-Jun-03 16:50 
QuestionWhere to find DISK DEFRAGMENTER source code? Pin
Bartosz Bien18-Jun-03 9:09
Bartosz Bien18-Jun-03 9:09 
AnswerRe: Where to find DISK DEFRAGMENTER source code? Pin
John M. Drescher18-Jun-03 9:27
John M. Drescher18-Jun-03 9:27 
AnswerRe: Where to find DISK DEFRAGMENTER source code? Pin
John M. Drescher18-Jun-03 16:47
John M. Drescher18-Jun-03 16:47 
GeneralRe: Where to find DISK DEFRAGMENTER source code? Pin
Bartosz Bien18-Jun-03 22:35
Bartosz Bien18-Jun-03 22:35 
GeneralRe: Where to find DISK DEFRAGMENTER source code? Pin
John M. Drescher19-Jun-03 0:14
John M. Drescher19-Jun-03 0:14 
QuestionHow to clear CFrameWnd Pin
Shay Harel18-Jun-03 8:21
Shay Harel18-Jun-03 8:21 
AnswerRe: How to clear CFrameWnd Pin
Maximilien18-Jun-03 8:49
Maximilien18-Jun-03 8:49 
GeneralRe: How to clear CFrameWnd Pin
Shay Harel18-Jun-03 9:12
Shay Harel18-Jun-03 9:12 
QuestionPossible reason why a fileread fails? Pin
georgiek5018-Jun-03 8:10
georgiek5018-Jun-03 8:10 
AnswerRe: Possible reason why a fileread fails? Pin
AlexO18-Jun-03 8:18
AlexO18-Jun-03 8:18 
GeneralRe: Possible reason why a fileread fails? Pin
georgiek5018-Jun-03 14:17
georgiek5018-Jun-03 14:17 
GeneralQuestion about Kodak CImgEdit Control Pin
MarcoNedwig18-Jun-03 7:08
MarcoNedwig18-Jun-03 7:08 
GeneralGetting Started in Visual C++.NET Pin
Nino_118-Jun-03 6:11
Nino_118-Jun-03 6:11 
GeneralRe: Getting Started in Visual C++.NET Pin
valikac18-Jun-03 6:47
valikac18-Jun-03 6:47 

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.