
  '=====================
  'USING FUNCTION TABLES
  '=====================
  '
  '
  '

  extern

  '---------------------------
  function f1(string* s) as sys
  '===========================
  print "ok1 " s
  end function

  '---------------------------
  function f2(string* s) as sys
  '===========================
  print "ok2 " s
  end function

  end extern


  'DEFINE FUNCTION TABLE
  '=====================

  'type ft
  'function f1(string* s) as sys
  'function f2(string* s) as sys
  'end type

  type ft
    sys (*f1)(string*s)
    sys (*f2)(string*s)
  end type


  'CREATE TABLE
  '============

  sys d[16] 'some reserved space

  'ft t 'direct table

  ft *t 'indirect table
  @t=@d ' assign address to table


  'LINK TABLE FUNCTIONS TO ACTUAL FUNCTIONS
  '========================================

  @t.f1=@f1
  @t.f2=@f2


  'TEST FUNCTIONS
  '==============

  't.f1 "one"
  't.f2 "two"


  'SHOW ENCODED TABLE STRUCTURE
  '============================

  '#recordof ft


  'CREATE LINKED TABLES
  '====================

  type gt
  ft *a
  ft *b
  end type

  gt u

  'LINK TO TABLE T
  '===============

  @u.a=@t
  @u.b=@t


  'TEST LINKAGE
  '============

  u.a.f1 "U,A.F1"
  'u.a.f2 "U,A.F2"
  u.b.f1 "U,B.F1"
  u.b.f2 "U,B.F2"




