The stock counter turned twenty and still builds

Go down

The stock counter turned twenty and still builds

· #1

I rebuilt a console stock counter whose oldest source file is twenty years old. It still produces the expected totals for its saved sample data. The comment promising to replace the menu next month is also intact.

I want to build a Windows version from Linux. No LCL, no external libraries, just text files and a menu that has declined every design trend since its birth.

Re: The stock counter turned twenty and still builds

· #2

Does changing the output filename to end in .exe do anything useful? I am asking before creating a very confidently named Linux executable.

Re: The stock counter turned twenty and still builds

· #3

The filename does not select the target. With a configured x86-64 Windows target and its matching RTL units available, this command builds for 64-bit Windows:

bash
fpc -Twin64 -Px86_64 inventory.pas

The target CPU compiler, target units, search paths, and any required binary tools must be in place. A native Linux installation alone does not guarantee that setup. FPC supplies internal linking for this Windows target, so do not assume every target needs an external linker.

The cross-compiling guide explains those prerequisites. For an LCL application there would also be target LCL units and a widgetset to build. This console program avoids that extra step.

Re: The stock counter turned twenty and still builds

· #4

Before declaring the port finished, check assumptions about integer and pointer sizes, path handling, and any records written directly to disk. A successful compile does not prove an old binary file format is unchanged.

Keep known input files and expected totals. Test the Windows executable on Windows, including filenames with spaces and non-ASCII characters. The operating system deserves a chance to disagree before the users do.

Pete · thirty years of begin and end "It compiled on my machine."

Re: The stock counter turned twenty and still builds

· #5

Built with the configured Windows target and tested on Windows. The sample totals match. The program uses text files rather than dumped records, which spared me one investigation.

I fixed one hard-coded path separator and checked the filename cases. The menu still says “New features soon.” I have preserved that as a historical claim, not a schedule.

Re: The stock counter turned twenty and still builds

· #6

Twenty years is sufficient notice that the menu is permanent.

Forum rules 1 to 10 apply. Yes, to you.

Go up

Sign in to reply