Answer the question
In order to leave comments, you need to log in
How to organize data selection by condition?
RAD Studio 10.1 Berlin software.
Everything works, but you need to change the code. Namely, somehow remove the condition from the code to an external file, so that it can be changed. In the meantime, the condition is "sewn" into the program.
The meaning of the program is that there is a two-dimensional array that needs to be filtered. (A sort of table - simplified.)
The array consists of 100 elements and 50,000 rows.
Filtering is carried out by the first 5-6 fields.
The filter conditions are equal, not equal, contains, and, or.
Condition matched - no error, array string passes. And all this is now in the program code.
But conditions are changing. Like their meanings, so sometimes logic is a sequence.
Example
if ((A1='1') and (CountPos('A13.29',A2)>0) and (A3='73') and (A4='97') and (A5='3')) then error:=0;
if ((A1='222') and (CountPos('A13.29',A2)>0) or (A3='73') and (A4!='97') and (A5='3') and (A5<>'4')) then error:=0;
if (
((условие 1) оператор (условие 2) оператор (условие 3)) ОПЕРАТОР
((условие 1) оператор (условие 2) оператор (условие 3)) ОПЕРАТОР
((условие 1) оператор (условие 2) оператор (условие 3)) ОПЕРАТОР
((условие 1) оператор (условие 2) оператор (условие 3))
) then begin end;
Answer the question
In order to leave comments, you need to log in
The array has 100 elements and 50,000 rows.
Support Ronald McDonald . The database is requested here. I think even some SQLLite will do. And edit requests as you like.
If you solve the problem completely according to the written one, then you can try to fasten something like this: https://www.remobjects.com/ps.aspx But I didn’t use it, I can’t guarantee anything.
When using XLSReadWriteI , you can store conditions in a text file and load them via VBA Macros
.
There are options:
1. Draw a gui so that it repeats the maximum combination, as you gave in the example. Those. for each position (condition N) you give the opportunity to choose a variable, with what and how to compare it. Moreover, you make the fields optional, i.e. so that some can be left blank.
Here is an example of how something similar is done in TheBat!
2. Connect a scripting language ( Lua or Pascal-like DWScript , RemObjects PascalScript ) and write simple instructions for users.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question