
'
'
'
'         ###############
'       ###################
'      ###               ###
'     ###    ###          ###
'    ###    ## ##         ###
'    ###   ##   ##        ###
'    ###  ##     ##       ###
'    ###  ##      ##      ###
'    ###  ##      ##      ###
'    ###   ####  ##      ###
'     ###    ####       ###
'      ###             ###
'       ###           ###
'         #############
'           #########


'-------------
'CLASS LIBRARY
'=============

  'Oxygen independent
  '$dll
  '$filename "greeting.dll"
  'uses rtl32

  extern export

  class greeting
  '=============

  bstring hi,bye
  
  method hello(string n)
  print hi n
  end method

  method goodbye(string n)
  print bye n
  end method

  method free()
  del hi
  del bye
  del this
  print "freed"
  end method

  end class


  function NewGreetingObject() as greeting*
  =========================================
  new greeting g
  g.hi="Hello "
  g.bye="Goodbye "
  return @g
  end function

  end extern


  extern virtual
  class greeting
  ==============
  method hello(string n)
  method goodbye(string n)
  method free()
  end class
  end extern

  'declare NewGreetingObject lib "greeting.dll" () as greeting*

  greeting g at NewGreetingObject()
  g.hello   "world"
  g.goodbye "world"
  g.free

