FILEPI


ANSI

 

The FILEPI instruction locks the specified files from usage by other PL/B programs for the specified number of instructions. It uses one of the following formats:

 

(1)

[label]

FILEPI

{count};{list}

(2)

[label]

FILEPI

0

(3)

[label]

PI

0

 

Where:

label

Optional. A Program Execution Label.

count

Required. A decimal constant or Expression that designates the number of instructions the file(s) is locked.

list

Required. A list of logical FILE, IFILE, and/or AFILE definitions or a FILELIST that is locked.

Flags Affected: NONE

Note the following:

  1. FILEPI automatically terminates upon the occurrence of a GUI object method or any of the following verbs:

  2.  

    ACTIVATE

    DISPLAY

    KEYIN

    PRTOPEN

    SHUTDOWN

    ALERT

    DSCNCT

    OPEN

    PRTPAGE

    SNDOPEN

    BEEP

    EVENTCHECK

    PAGESETUP

    PREP

    SPLOPEN

    CHAIN

    EVENTWAIT

    PAUSE

    RELEASE

    PERFORM

    COMCHECK

    EXECUTE

    PRINT

    RELEASEJOB

    SPLCLOSE

    DBCONNECT

    GETFNAME

    PRTCLOSE

    ROLLOUT

    STOP

     

  3. A FILEPI automatically terminates upon the program stopping, returning control to a modal DIALOG or if an untrapped error occurs.

  4. The FILEPI instruction counter is not decremented by the following verbs:

  5.  

    BRANCH

    ELSE

    LOOP

    RETURN

    BREAK

    ELSEIF

    LROUTINE

    ROUTINE

    CALL

    ENDIF

    NORETURN

    STOP

    CALLS

    GOTO

    PERFORM

    UNTIL

    CONTINUE

    IF

    REPEAT

    WHILE

     

  6. To terminate a FILEPI prior to its scheduled release, PI 0 or FILEPI 0 may be used.

  7. {count} must be in the range of one (1) to ninety-nine (99).

  8. {list} may be from one (1) to twenty (20) open file definitions that are locked.

  9. FILEPI is not supported by the PLBCE runtime.

  10. If an AAM or ISI file is specified in {list}, the actual file that is locked is the data file associated with the index. Therefore, multiple index files that point to the same data file should not be specified in {filelist}. Locking the data file once covers all index files with which it may be associated.

  11. If {list} specifies a FILELIST, all files within the list are locked.

  12. In a situation where a data file is being accessed both with and without Record Locking, a FILEPI instruction will only be able to lock and gain to access to the file when all record locks are released for the file. In addition, it is possible that a FILEPI can cause an infinite deadlock situation if a record lock is active and the FILEPI is executed in the same program.

  13. A FILEPI 1 instruction is not required to cover any IFILE or AFILE IO instructions. Additionally, if a FILEPI 1 instruction is executed to cover a single READ of an AFILE or IFILE, this FILEPI usage minimizes the capability of a PLB Linux runtime from optimizing IO operations to give the best performance.

 

 

See Also: Example Code, SHARE Access Mode, Disk I/O Instructions

 



PL/B Language Reference FILEIO FILTER