Small details:
I use 2 distinct procedures for my incremental searches
1- a procedure for searching on String fields (there are specific additional treatments in this procedure which do not need to be in searches on numeric fields)
2- in procedure for searching numeric fields.
You will notice that I defined a variable "WKleSearchN" inside this procedure. This variable is normally defined at the very beginning of the unit. But as I had to make numerous (unsuccessful) attempts, I found more practical to redefine this variable in the search procedure, which avoids me, each time, going back to the very beginning of the unit to modify the type of this variable.
This is why, in the code cited above, this variable is of type String. This is the last test that I carried out, but obviously, I tested all kinds of combinations, without perfect results.
Concerning the research, in the current state, I noticed this:
if the column I want to search for contains
5.00
52.15
68.87
525.18
525.23
525.32
638.55
....
Entries Result
5 OK out of 5.00
52 OK out of 52.18
525 Remains on 52.18
525. Rest on 52.18
525.3 Rest on 52.18
525.32 OK
525.32 : The cursor only moves if, and only if, the exact amount is found.
This is not what I expect from my research, but to be able to get as close as possible to the amount I am looking for, not knowing in advance the exact amount, to the nearest cent.
To Jamie:
Abort suits me perfectly. I don't need to do a search if the input edit is blank or zeros. This is the case when I go back, or when I reset the research edit. But maybe I'm missing something?
a paweld
I downloaded your program, but cannot test it.
when trying to compile, I get the following messages
Compilation du projet - Cible : project1 : Code de sortie 1 - Erreurs : 1
Unit1.pas(8,22) Fatal: Impossible de trouver Forms utilisé par Unit1. Vérifier que le paquet LCLBase est dans les dépendances.
TryStrToFloat: I didn't know this function. I will test with this function.
I tested with the StrToFloat function, without entirely satisfactory results.