2d Array or record? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

2d Array or record?

Perand1414Perand1414 Posts: 2Member
I'm making a program to update our prices and discount.
Reading a file, layout : G30;48
which means discount code is G30 which in turn equal 48%
I can read it but need a simple example on how to implement it.

I read a line in the pricefile, this line contains different info, like number, text and discount code, so I have to determine the discount everytime I read a line, but would like to make the work as little as possible, since I have to read around 108.000 lines and work on them, any suggestions?

regards
John

Comments

  • DWDuckDWDuck Posts: 31Member
    : I'm making a program to update our prices and discount.
    : Reading a file, layout : G30;48
    : which means discount code is G30 which in turn equal 48%
    : I can read it but need a simple example on how to implement it.
    :
    : I read a line in the pricefile, this line contains different info,
    : like number, text and discount code, so I have to determine the
    : discount everytime I read a line, but would like to make the work as
    : little as possible, since I have to read around 108.000 lines and
    : work on them, any suggestions?
    :
    : regards
    : John
    :
    Good day

    If I were u I'd use a record with too fields...
    Type
    Priceline = Record
    Code : String[3];
    Discount : Real;
    End;

    Using this u can easily make a search function that can find the discount % by searching for the code....

    This also makes it very easy to change the percentages later on when u need it...
    Darkwing Duck aka DWduck signing off :)
Sign In or Register to comment.