Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14007

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
2d Array or record? Posted by Perand1414 on 23 Oct 2012 at 3:48 AM
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
Report
Re: 2d Array or record? Posted by DWDuck on 31 Oct 2012 at 2:54 AM
: 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 :)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.