Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Lock routine ====== ==== Description ==== Provides a method for coordinating access to tables, rows, or columns by setting locks ==== Syntax ==== **Lock**(//tablename//, //key//, //columnlist//, //locktype//) ==== Parameters ==== The Lock routine has the following parameters. ^Parameter^Description^^ |//Tablename//|Specifies the name of the table to lock.|| |//Key//|Key of the row to lock. If null, the entire table is locked.|| |columnList|An @fm delimited list of columns to lock. If the columnList is null the entire record is locked.|| |//Locktype//|Set one of four lock types:\\ \\ __locktype__ - __Description__\\ 0 - Exclusive lock.\\ 1 - Shared lock.\\ 2 - Exclusive coordinated lock (row and column locks only).\\ 3 - Shared coordinated lock (row and column locks only).| ==== Remarks ==== Since the Lock routine uses the Lock statement, it is more efficient to use the Lock statement in a BASIC+ script. ==== Examples ==== <code> /* Lock and unlock specific columns within a row */ declare subroutine lock, unlock table = 'PRODUCTS' row = '3542-5-310-1' cols = 'DESCRIPTION':@fm:'PRICE' locktype = "" Lock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End * Do Some Processing call Unlock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End /* Lock and unlock a row */ declare subroutine lock, unlock table = 'PRODUCTS' row = '3542-5-310-1' cols =%%''%% locktype = "" Lock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End * Do Some Processing Unlock(table,row,cols,locktype) status = Get_Status(errCodes) If status Then FSMsg(errCodes) End </code> guides/programming/programmers_reference_manual/lock_routine.txt Last modified: 2024/06/19 20:20by 127.0.0.1