I have a file with data like this:

ЧУ ЧУ Тренировка 24.05.2011 12:56:40 2 5 5 5 5 2 5 5 5 5 5 5 ЧУ ЧУ Тренировка 24.05.2011 21:41:27 2 2 5 2 2 5 2 2 2 5 2 

I need a function that will search for the last program launch, i.e. determine which string of the type ChU ChU Training on 05/24/2011 12:56:40 older, analyze the numbers that follow, i.e. 2 and 5, and if the number 2 occurs more than twice, then ... I’ll think of something there, but for now just display showmessage ('Your rating is 2'); Accordingly, if all 5, or one two two, is permissible, then showmessage ('Your rating is 5'); How to implement it:?

  • Do you have the same number of assessments each time? ... - Leshij_2005

1 answer 1

Well, it's simple.

We are looking for an NC line. NCU. If found, then add the following digits to an array / collection.

If the string of an NCU is found again, this is not the last line (we remove the added numbers from the collection), after which we add these numbers again.

When reading a file, we will always have the latest data ...

PS: I don’t write the code in principle. Evolve :)

  • Yes, but ChU Chu is the name and surname, they may be different. Maybe you should just add a constant value to the beginning of the line of the type to be tested: First Name Last Name Time Date Can I start searching from the end of the file? - chuikoff
  • Add something like: - Chu Chu ... And in the program you will already check if (first_two_symbols_in_string = '-') then begin {this is the name ...} end; - Alex Kapustin