[fpc-pascal] Selecting Records with a variable
James Richters
james.richters at productionautomation.net
Sun Dec 20 19:53:41 CET 2020
Yes, I was trying to keep my data structure, because there were thousands of occurrences ..
This project has had that structure since Turbo Pascal back in the 80s when it only had 3 axis
It seemed like a good way to have variables all with the same name, and back then it wasn't so bad to have repeated code,
but now I have 9 axis and it's getting ridiculous.. once I realized that Arrays would allow me to simplify things greatly,
it turned out to not be so bad to change it... just a bunch of global search and replaces and a little fixing here and there that actually made it cleaner,
and the whole project has been changed over in a relatively short amount of time... and now I can start consolidating all those functions and procedures.
It was way less work to just change it all to a better structure than it was to work around it.
James
>I think this is a typical example where properly thinking about a solution for a programming issue BEFORE going with
>what seems as the logical choice at first glance leads to a much simpler solution without coming up with all kinds of fancy workarounds...
More information about the fpc-pascal
mailing list