Author Topic: Broken "RECORD"  (Read 116 times)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Broken "RECORD"
« on: August 04, 2020, 12:48:17 AM »
I believe I have succeeded in creating a large file support (LFS) runtime function to replace the "C" function fseek.

While integrating those changes into BCX, I observed the "RECORD" command uses fseek

"RECORD" has an entry in the fabulous BCX Help file, so I know how its supposed to be used and
what it's designed to accomplish.  The code for "RECORD" was actually added in 288 while the help file
added notes in 289, per Robert's history log in the Help File. 

My bug report concerns the fact that the code implementing "RECORD" has been broken from the very beginning in June 2002.
It is so bad, I cannot imagine any compiler ever accepting the code.  That suggests to me that no one has ever adequately
tested the "RECORD" command, let alone use it in a real world application.

I would appreciate a second set of eyeballs taking a look at "RECORD" in the source code before I put any effort
into reworking it to use the new Seek() command.  The pertinent code begins at line 27,387 in BCX v751.

Thanks !

Robert

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: Broken "RECORD"
« Reply #1 on: August 04, 2020, 02:03:31 AM »
I believe I have succeeded in creating a large file support (LFS) runtime function to replace the "C" function fseek.

While integrating those changes into BCX, I observed the "RECORD" command uses fseek

"RECORD" has an entry in the fabulous BCX Help file, so I know how its supposed to be used and
what it's designed to accomplish.  The code for "RECORD" was actually added in 288 while the help file
added notes in 289, per Robert's history log in the Help File. 

My bug report concerns the fact that the code implementing "RECORD" has been broken from the very beginning in June 2002.
It is so bad, I cannot imagine any compiler ever accepting the code.  That suggests to me that no one has ever adequately
tested the "RECORD" command, let alone use it in a real world application.

I would appreciate a second set of eyeballs taking a look at "RECORD" in the source code before I put any effort
into reworking it to use the new Seek() command.  The pertinent code begins at line 27,387 in BCX v751.

Thanks !

Hi MrBCX:

Absolutely, positively, RECORD did work in the past. It was a long time ago but I do remember being very impressed with it's functioning.

I will try to retrace my footsteps back.

Robert

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: Broken "RECORD"
« Reply #2 on: August 04, 2020, 02:24:52 AM »
I believe I have succeeded in creating a large file support (LFS) runtime function to replace the "C" function fseek.

While integrating those changes into BCX, I observed the "RECORD" command uses fseek

"RECORD" has an entry in the fabulous BCX Help file, so I know how its supposed to be used and
what it's designed to accomplish.  The code for "RECORD" was actually added in 288 while the help file
added notes in 289, per Robert's history log in the Help File. 

My bug report concerns the fact that the code implementing "RECORD" has been broken from the very beginning in June 2002.
It is so bad, I cannot imagine any compiler ever accepting the code.  That suggests to me that no one has ever adequately
tested the "RECORD" command, let alone use it in a real world application.

I would appreciate a second set of eyeballs taking a look at "RECORD" in the source code before I put any effort
into reworking it to use the new Seek() command.  The pertinent code begins at line 27,387 in BCX v751.

Thanks !

Hi MrBCX:

I don't want to sound like a broken record, but the example is broken

The same pathetic, lost soul which changed instances of FP1 to fp1 in other places in the help file screwed up the RECORD example.

I think I had better do a mass check on file handles.

Corrected all file handles to FP1, and the RECORD example compiles and runs as expected.

Code: [Select]

C:\dev\BCX\BCXCode\RECORD>record
Filename of database to open ? bob.data
File does not exist. Create?(Y/N)Y
Press 0 to quit
Press 1 to add record
Press 2 to get record
1
Database contains 0 records.
Add record number 1
First Name Bob
Middle Name Bob
Last Name Bob
Age 6
Add another record(Y/N)? N
Press 0 to quit
Press 1 to add record
Press 2 to get record
0

C:\dev\BCX\BCXCode\RECORD>record
Filename of database to open ? bob.data
Press 0 to quit
Press 1 to add record
Press 2 to get record
2
Get record number(0 to quit) 1
Bob
Bob
Bob
 6
Get record number(0 to quit) 0
Press 0 to quit
Press 1 to add record
Press 2 to get record
0



MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Re: Broken "RECORD"
« Reply #3 on: August 04, 2020, 08:36:16 AM »
Thanks Robert --

Having a working example went a long way for helping me understand the inner workings of the commands. 

What I didn't get yesterday was the way Wayne appended the word "len" to the name of the file pointer variable, so that "FP1" became a second variable named "FP1len" which gets added to the user's program as an integer variable during translation and is used by the function RECCOUNT and similarly by RECORD. 

The example will also help me test the new SEEK command which, by the way, should allow many more records to be added to the example's database :-)