I assume this is simple enough, when you know how :)

I retrieve 2 files, pricelist with multiple information such as number, price, desciption and so on,
the 2. file is discount file, with 2 fields : discountcode;discount like G30;48
which means discountcode = G30 which equals 48%

I have a program to read the pricefile, but in order to get the right discount without having to build the exact codes into the program, I would like to read the discount from file perhaps into table/records and then determine for each number what the discount should be, also I would like to exit the discount reading when the right code i hit, since the priceprogram have to read around 120.000 numbers.

So I seek a solution and maybe a simple "How to"

John

If you change your discount file so it uses

G30=48

then you can use it as a TIniFile.

Could you give a little example, I never really learned Delphi just trying to adapt my Pascal to Delphi.

The discountfile is CSV, so it's easy to replace ; with = but then I'm lost.

The ideal would have been something like
case discount of :
easy to handle and jump out when found, to minimize time in loop.
Sorry if I'm too newbee :)

Here is a nice introduction.

Thank you very much :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.