REM ************************************************************ REM ********* L O C K I T . B A S Ver 1.0 ************* REM ********* M2CBASIC TM Ver 1.4 ************* REM ********* Lock a record in a data file ************* REM ********* ALL RIGHTS RESERVED ************* REM ********* 07-21-84 ************* REM ************************************************************ REM CLEAR SCREEN IBM PC under CONCURRENT PC-DOS REM Change this code to the one needed by your system or delete the line. PRINT CHR$(27) ; "E" PRINT TAB(20);"L O C K I T" PRINT : PRINT PRINT " This program is designed to test record locking on your system." PRINT " The default file is TEST2.DAT with a record length of 117 ." PRINT " Do you want to use these defaults (Y/N) ";:INPUT YN$ IF LEFT$(UCASE$(YN$),1) <> "Y" THEN \ PRINT : \ PRINT " You must now specify the exact name, extension, and rec length.":\ INPUT " What file name do want to use (FILENAME.EXT) ";FNAME$ :\ INPUT " What is the record length ? ";RLENGTH% :\ OPEN FNAME$ RECL RLENGTH% AS 1 UNLOCKED :\ PRINT :\ PRINT " File ";FNAME$ ;" with a rec length of ";rlength% ; " is open." :\ ELSE \ PRINT :\ PRINT " TEST2.DAT with a rec lenth of 117 will now be opened." :\ OPEN "TEST2.DAT" RECL 117 AS 1 UNLOCKED PRINT INPUT " What record number do you want to LOCK ? ";RNUMB% I% = LOCK(1,RNUMB%) PRINT IF LEFT$(UCASE$(YN$),1) = "Y" THEN \ PRINT " Go to the other terminal or window and run TEST2 ":\ ELSE \ PRINT " Go to the other terminal or window and run your other application" PRINT " Try to access REC ";RNUMB% ; " and also other records." PRINT " When you are ready to unlock the record please enter QUIT." loop: PRINT TAB(20);" (QUIT)";:INPUT QUIT$ IF LEFT$(UCASE$(QUIT$),1) = "Q" THEN \ CLOSE 1 :\ PRINT :\ PRINT " All records released and files closed. " :\ ELSE \ GOTO LOOP END