Files
harbour-core/tests/persist.prg
vszakats a4a357a18b 2013-03-15 11:12 UTC+0100 Viktor Szakats (harbour syenar.net)
* /harbour/* -> /*
    * moved whole Harbour source tree one level up to
      avoid single 'harbour' top dir
2013-03-15 11:13:30 +01:00

44 lines
803 B
Plaintext

/*
* $Id$
*/
// Class HBPersistent test
#include "hbclass.ch"
PROCEDURE Main()
LOCAL oTest := Test():New()
LOCAL oTest2 := Test2():New()
oTest:One := "hello"
oTest:Two := 123
oTest:Three := "this value is not persistent"
oTest:Four := oTest2 // We store another persistent object here
oTest2:Five := "some more text"
? oTest:SaveToText() // We save it to a text
oTest:SaveToFile( "test.txt" ) // We save it to a file
RETURN
CREATE CLASS Test FROM HBPersistent
VAR One PROPERTY
VAR Two PROPERTY
VAR Three
VAR Four PROPERTY
METHOD Another() INLINE { 1, { "One", "Two" }, Date() } PROPERTY
METHOD More() VIRTUAL
ENDCLASS
CREATE CLASS Test2 FROM HBPersistent
VAR Five PROPERTY
ENDCLASS