PxPlus User Forum

Main Board => Discussions => Language => Topic started by: James Zukowski on January 27, 2023, 06:08:13 PM

Title: Potential problem in multifile.pvc
Post by: James Zukowski on January 27, 2023, 06:08:13 PM
While testing/preparing to use split files, I ran into a situation with an embedded io routine. In multifile.pvc, the Do_Pre_Write routine does its thing until it gets to:
Code: [Select]
if IoType=1 then write lock record (Chnl[_Found_chnl],key=_key$)_rec$ else write lock record (Chnl[_Found_chnl])_rec$
!
if and(_opt,64)=64 then gosub Extract_Update else extract release (lfa); gosub Extract_Free
Our embedded io routine does some post-write processing. This is called by the write lock record directive. It opens a reference file, reads it, then closes it. (There may also be some additional writing, based on results of this read.) Since _opt is 0, the next code line tries an extract release for lfa, but lfa was not the Chnl[_Found_chnl] in the write line. Changing lfa to Chnl[_Found_chnl] in the extract release line works fine in this situation.

However, there are other references to extracts and lfa elsewhere that I haven't gone through yet. These may be affected by post-read and post-write routines in embedded io routines.

Thought you'd like to know...