added LSL2 stored procedures
This commit is contained in:
29
LSL2/STPROC/RECORD_LOCK.txt
Normal file
29
LSL2/STPROC/RECORD_LOCK.txt
Normal file
@ -0,0 +1,29 @@
|
||||
compile subroutine record_lock( TableVar, TableName, Row )
|
||||
|
||||
$insert logical
|
||||
declare subroutine msg
|
||||
declare function send_info
|
||||
|
||||
Tries = 0
|
||||
Locked = false$
|
||||
|
||||
LOOP
|
||||
LOCK TableVar, Row THEN
|
||||
Locked = true$
|
||||
END ELSE
|
||||
Tries += 1
|
||||
END
|
||||
|
||||
UNTIL Locked OR Tries >= 500
|
||||
REPEAT
|
||||
|
||||
IF NOT(Locked) THEN
|
||||
IF STATUS() THEN
|
||||
ErrMsg = "Record ":Row:" in File ":TableName:" is locked by your station"
|
||||
END ELSE
|
||||
ErrMsg = "Record ":Row:" in File ":TableName:" is locked by another station"
|
||||
END
|
||||
MSG(ErrMsg)
|
||||
END
|
||||
|
||||
RETURN
|
Reference in New Issue
Block a user