Compile function UTILITY_TABLE_INFO_EVENTS(Event, CtrlEntId, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13)

Equ CRLF$ to \0D0A\
Equ Tab$  to \09\

Declare subroutine Set_Property, Send_Message
Declare function Get_Property

If Assigned(Event) else Event = ""
If Assigned(CtrlEntId) else CtrlEntId = ""
If Assigned(Param1) else Param1 = ""
If Assigned(Param2) else Param2 = ""
If Assigned(Param3) else Param3 = ""
If Assigned(Param4) else Param4 = ""
If Assigned(Param5) else Param5 = ""
If Assigned(Param6) else Param6 = ""
If Assigned(Param7) else Param7 = ""
If Assigned(Param8) else Param8 = ""
If Assigned(Param9) else Param9 = ""
If Assigned(Param10) else Param10 = ""
If Assigned(Param11) else Param11 = ""
If Assigned(Param12) else Param12 = ""
If Assigned(Param13) else Param13 = ""
Window = Field(CtrlEntId, ".", 1)[1, "F*"]
Control = Field(CtrlEntId, ".", 2)

// Editor events
Events  = "CLICK.PUB_LOOKUP,LOSTFOCUS.EDL_TABLE,GOTFOCUS.EDL_TABLE"

Locate Event in Events using "," setting Pos then
    On Pos Gosub CLICK.PUB_LOOKUP, LOSTFOCUS.EDL_TABLE, GOTFOCUS.EDL_TABLE
end

If Assigned(Ans) else Ans = 1

Return Ans


//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//	EVENTS
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


CLICK.PUB_LOOKUP:
    
    Table = Get_Property(@Window:".EDL_TABLE", "TEXT")
    Columns = Get_Property(@Window:".EDB_COLUMNS", "TEXT")
    Swap CRLF$ with @FM in Columns
    NumColumns = Count(Columns, @FM) + (Columns NE "")
    
    Output = ""
    For iCol = 1 to NumColumns
        Column = Columns<iCol>
        If Len(Column) then
            Pos = Xlate("DICT.":Table, Columns<iCol>, 2, "X")
            Type = Xlate("DICT.":Table, Columns<iCol>, 12, "X")
            If Pos EQ "" then Pos = "SYM"
            Output<-1> = Pos:@VM:Type
        end
    Next iCol
    
    Swap @FM with CRLF$ in Output
    Convert @VM to Tab$ in Output
    Set_Property(@Window:".EDB_OUTPUT", "TEXT", Output)
    
    Set_Property(@Window:".EDB_OUTPUT", "FOCUS", 1)
    Set_Property(@Window:".EDB_OUTPUT", "SELECTION", 1:@FM:Len(Output))
    
return

LOSTFOCUS.EDL_TABLE:

    Set_Property(@Window:".EDB_COLUMNS", "TEXT", "")

return

GOTFOCUS.EDL_TABLE:

    Set_Property(@Window:".EDL_TABLE", "SELECTION", 1:@FM:9999)

return
