rebfpt.prg

(App, Hungary)

In brief, a resurrector of croaked tables.

I started writing it as early as in Gemenc, because in PolC the fucken altos would screw the patients table sideways every now and then. Happened elsewhere more later. Special mention goes to zzzzz and somewhat the Ledinje, where the network was prone to crashes and their tables to becoming loose load. Another special mention is Leanne, who'd yank her blue patch cable from her desktop box without first exiting Hossy, to replug it into her laptop, which she did quite a few times. But then they did have CMRepair or some such tool, or managed to just pack the table and thus rebuild its structure, so I didn't even think to offer this tool.

It's not that there weren't crashed tables before, but it was usually only the header that would get screwed, something would remain unwritten - either records were added at the end but the record counter in the header wasn't written, or the header was up to date but the OS wouldn't have the time to write the last added blocks into Fata* (i.e. FAT), so on next open the table would get some random blocks added instead, and those last records would contain garbage. Sale wrote a dbfrcn.exe (dbf records number) to fix that problem, so it would fix the header or trim the extra rows, usually leaving some garbage in the last fields of the last record, but at least fox could open the table so further work was possible.

There were creative events too, when someone, for example, opened a table in Wordstar and saved it as a document, formatted... Still, the worst trouble was the Dos 4.0, conceivably m$'s biggest pre-windowses blunder, which sometimes would replace a bunch of blocks in the middle of a table with random blocks, not even the same number of them... what garbage I found in there, ouch. Once in klaanca I spent two hours pulling out usable content from a table, barely managing to save some 97% of content. The rest they had to check and reenter from printouts.

The Dos 4 was the only OS I ever saw that managed to somehow display the same file twice in the same directory.

The bigger problem were larger fuckups, when fox couldn't even open the table, which happened specially when altos kept crashing (v. 24-X-1994.), where not just the indexes would suffer, but the memo fields as well. For indexes I already had a generator of routines, which would simply erase the existing index and make one from scratch. The fox's ability to repair an index was worthless when its header was erased and it couldn't find the index expression to build index from.

Just like I did with other time consuming stuff, the crashed tables were soon on the automatization to-do list... so this piece of code came to existence. The last version of it was in, I'd say, 2003. That's when Berix needed something of the kind, because of a problem that... I guess some of Joe's customers with lousy machines had. Eh, once upon a time it was engineers who used computers and they knew to take care of them. Nowadays it's the university team's coaches, who knows what goes on there... Still, the rebfpt would pull them out of the pit.

The trick was to not wash the table, but rather make new. With the same structure (fields with same names, in same order, of same types and lenghts), then tread the old one, row by row (and the length of the row is known from the time when the table was whole and could be opened nicely), then each row is cut into pieces of required length for each field, and then these pieces are transformed into values to be written. For memo fields that value was the address of a block in the fpt file in which the text resided, and the length of that text was in the first four bytes of that block, which I also found a way to read. This last version was also capable of reading the binary packed fields, i.e. floating point numbers, datetimes.

And then this was, after 2003, crouching forgotten on my disk (and a copy of the dos version pretty much everywhere where Avai had customers) until in november 2021 someone on UA needed it so I zipped the latest and uploaded it, then again in november 2023 when Kristin had a crashed fpt, and the discussion after it went in few directions, ending in me putting that zip in public on sGradlj.com and then also writing this text.

----

* Fata aka Fatima is the easy lay girl/mistress/wife in bosnian jokes


Mentions: 24-X-1994., 09-I-1995., 27-II-1995., 06-III-1995., 10-III-1995., 17-IV-1995., 01-V-1995., 01-VI-1995., 05-VI-1995., 25-II-1996., 05-VII-1997., 27-VIII-1997., 05-IV-2001., 16-IV-2003., 13-XII-2003., 10-XI-2023., Aleksandar Raskov (Sale), altos, Avai, Cecilia Roxbury (Berix), fox, Gemenc, Hossy, Joe Dioballato, klaanca, Kristin Peiser, Leanne Harper, Ledinje, Majkrosoft (m$), PolC, sGradlj.com, UbiquAgora (UA), zzzzz, in serbian

9-II-2024 - 28-II-2026