Created
July 7, 2016 21:16
-
-
Save jbratu/1d731be9c5e9bfcbdc7be78d4b6c0cd2 to your computer and use it in GitHub Desktop.
Function accepts and OpenInsight table handle and resolve the handle back to a table name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function CS_RESOLVE_TABLE_HANDLE_TO_NAME(OpenTableHandle) | |
/* | |
Given the example: | |
Open 'SYSLISTS' To OpenTableHandle Else Debug | |
TableName = CS_RESOLVE_TABLE_HANDLE_TO_NAME(OpenTableHandle) | |
The Function will return the name of the table From the handle. | |
*/ | |
If Unassigned(OpenTableHandle) Then Return '' | |
FileVarName = OpenTableHandle<1,2> | |
AtTables5Count = DCOUNT(@Tables(5), @FM) | |
For i = 1 To AtTables5Count | |
CheckHandle = @Tables(5)<i> | |
If CheckHandle EQ FileVarName Then | |
*Found our handle in @TABLES(5) | |
TableName = @Tables(2)<i> | |
Return TableName | |
End | |
Next | |
*Couldn't find handle in @TABLES(5) | |
Return '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment