 | | | S/Web Objects 

LH Object This object handles information relating to Linear Hash files | Property | Get/Set | Description |
|---|
| CACHEHANDLES | Get/Set | Sets or retrieves flag indicating whether LH Table handles are cached. | | LOCKTYPE | Get/Set | Sets or retrieves flag indicating the LH lock type. 0 for optimistic, 1 for pessimistic (web only) and 2 for pessimistic (real time - web and local) | | LOCKTIME | Get/Set | Sets or retrieves the time that indicates when a held lock times out. | | UNLOCKQTIMEOUT | Get/Set | Sets or retrieves the amount of time to wait for another server to unlock the attempted record. | | XVERSION | Get | Contains the current S/Web version |
call www_Exec_Method( "LH", method, param1, param2, param3, param4, param5 ) | Method | Description |
|---|
| CREATE | Instantiate the current LH object, the constructor method. | | DELETE | Used to delete a row or record from an LH table or file. | | DESTROY | This method has not yet been implemented. | | GET | Used to get properties of the current LH object | | LOCK | Used to lock an LH row or record | | OPEN | Used to open an LH table or file. | | PURGE | Clears out all the locking data from the WWW_LH table and the current object. | | READ | Used to read a row or record from an LH Table or file | | READCACHE | Used to read a record that exists in the cache. This is similar to the R/BASIC or Basic+ READO statement. | | SET | Used to set properties of the current LH object | | UNLOCK | Used to unlock an LH row or record | | UNLOCKQ | Called by the server to released expired lock records. This is only used with shared Pessimistic locking | | WRITE | Used to write a row or record to an LH table or file |

This method should not be called by the end user! | Argument | Description | | param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |

This method deletes a row or record from an LH table or file. | Argument | Description |
|---|
| param1 | A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files. | | param2 | A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records. | | param3 | Polymorphic flag whose meaning depends on the type of locking in use. If the locktype is OPTIMISTIC then this value is Not used If the lock type is PESSIMISTIC then a TRUE$ will force a delete even if the client doesn't have the lock. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
TableNames = "SWEB_TEST_TABLE1" TableNames := @RM : "SWEB_TEST_TABLE1"
RowIDs = "DELETEME1" RowIDs := "DELETEME2"
if www_Exec_Method( "LH", "DELETE", TableNames, RowIDS, "", "", "", errorText ) then * The specified information has been deleted End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method has not yet been implemented | Argument | Description |
|---|
| param1 | Not Used | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |

This method retrieves properties for the LH object. | Argument | Description |
|---|
| param1 | The name of the property we wish to retrieve. This value can be @RM delimited to hold multiple properties | | param2 | Returns value of requested properties. This value will be @RM delimited to match param1 | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
Properties = "LOCKTYPE"
if www_Exec_Method( "LH", "GET", Properties, ReturnValues, "", "", "", errorText ) then * The specified information has been retrieved End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method locks a row(s) or record from an LH table or file. | Argument | Description |
|---|
| param1 | A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files. | | param2 | A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records. | | param3 | Returns true$ if locks successful. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
TableNames = "SWEB_TEST_TABLE1" TableNames := @RM : "SWEB_TEST_TABLE1"
RowIDs = "LOCKME1" RowIDs := "LOCKME2"
if www_Exec_Method( "LH", "LOCK", TableNames, RowIDS, Result, "", "", errorText ) then * The specified information has been locked End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method opens an LH table or file to a file variable. | Argument | Description |
|---|
| param1 | A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files. | | param2 | File variables returned. | | param3 | TRUE$ if file handle should be cached to speed up subsequent access. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
TableNames = "SWEB_TEST_TABLE1" TableNames := @RM : "SWEB_TEST_TABLE2" CacheState = False$
if www_Exec_Method( "LH", "OPEN", TableNames, hTableNames, CacheState, "", "", errorText ) then * The specified tables have been opened End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method deletes a row or record from an LH table or file. | Argument | Description |
|---|
| param1 | True$ if the locking table is to be purged, false if only the in memory locking flags are to be purged. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
ClearTableFlag = True$
if www_Exec_Method( "LH", "PURGE", ClearTableFlag, "", "", "", "", errorText ) then * All lock information has been removed End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method deletes a row or record from an LH table or file. | Argument | Description |
|---|
| param1 | A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files. | | param2 | A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records. | | param3 | Rows read returned in an @Rm delimited list. If Param4 is blank then complete rows will be returned. | | param4 | List of columns to read per row. An @Fm delimited list per @Rm delimited table. If null then all of the row(s) are returned. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
TableNames = "PARENT_TABLE" TableNames := @RM : "CHILD_TABLE"
RowIDs = "ROW1" RowIDs := @Rm : "ROW2" Columns = "" Columns := @Rm : 1 : @Fm : 2 : @Fm : "FULLNAME"
if www_Exec_Method( "LH", "READ", TableNames, RowIDS, Rows, Columns, "", errorText ) then * The specified information has been deleted End Else * There has been an error GoSub ErrorHandlingSubroutine End 
See READ method. Only difference is that READCACHE reads from the cache file - meaning the record as the current user read from disk on the initial read. Allows developer to ascertain whether row has changed since originally read from disk by issuing a read then a readcache. 
This method sets a property of the LH object. | Argument | Description |
|---|
| param1 | The name of the property we wish to retrieve. This value can be @RM delimited to hold multiple properties | | param2 | New values of requested properties. This value will be @RM delimited to match param1 | | param3 | Returns old values of requested properties. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
Properties = "LOCKTYPE"
Values = 1
if www_Exec_Method( "LH", "SET", Properties, Values, ReturnValues,"", "", errorText ) then * The specified information has been retrieved End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method unlocks a row or record from an LH table or file. | Argument | Description |
|---|
| param1 | A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files. | | param2 | A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records. | | param3 | Not used | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
TableNames = "SWEB_TEST_TABLE1" TableNames := @RM : "SWEB_TEST_TABLE1"
RowIDs = "DELETEME1" RowIDs := "DELETEME2"
if www_Exec_Method( "LH", "UNLOCK", TableNames, RowIDS, "", "", "", errorText ) then * The specified information has been unlocked End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method unlocks all pessimistic locks held by the server. It should normally only be called by the server object. | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
if www_Exec_Method( "LH", "UNLOCKQ", "", "","", "", "", errorText ) then * All locks have been removed End Else * There has been an error GoSub ErrorHandlingSubroutine End 
This method deletes a row or record from an LH table or file. | Argument | Description |
|---|
| param1 | A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files. | | param2 | A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records. | | param3 | Rows to write in an @Rm delimited list. Must conform to column spec of read. | | param4 | Polymorphic flag. If locking is optimistic then clear the record from the cache after a write (used if the client no longer has the lock) if set to True$. If locking is pessimistic then write regardless of whether client has lock. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
TableNames = "SWEB_TEST_TABLE1" TableNames := @RM : "SWEB_TEST_TABLE1"
RowIDs = "DELETEME1" RowIDs := @Rm : "DELETEME2"
* Rows built earlier in program
if www_Exec_Method( "LH", "WRITE", TableNames, RowIDS, Rows, False$, "", errorText ) then * The specified information has been written End Else * There has been an error GoSub ErrorHandlingSubroutine End [top] 
|  |  |  |