Page 3 of 3
MEMVARs, PUBLICs etc.
Posted: Thu Jun 13, 2019 9:41 pm
by Chris
Hi Karl,
Thanks, apparently the problem is that
? ValType(Evaluate("NIL"))
returns "O"
while
? ValType(NIL)
returns "U" as expected. Will log this right now, thanks!
MEMVARs, PUBLICs etc.
Posted: Tue Jun 18, 2019 5:02 pm
by Karl-Heinz
Hi Robert,
i´ve noticed that the behaviour of a PUBLIC and PRIVATE RELEASE has changed. Now both are "destroyed" like Foxpro does. To be sure, i´m asking if this behaviour is intended ?
regards
Karl-Heinz
MEMVARs, PUBLICs etc.
Posted: Thu Jun 20, 2019 7:24 am
by Karl-Heinz
Guys,
in the attachment is the next step: SAVE and RESTORE of memvars
regards
Karl-Heinz
Code: Select all
#INCLUDE "memvar.xh"
PUBLIC gc1, gc2 , gc3
PUBLIC gc4
PUBLIC ga1
PUBLIC ga2
FUNCTION Start( ) AS VOID
PUBLIC gc5 // another public
? "--------------------------"
? "PUBLICs content at startup"
? "--------------------------"
? "gc1 content:" , gc1 // ok, all show .f.
? "gc2 content:" , gc2
? "gc3 content:" , gc3
? "gc4 content:" , gc4
? "gc5 content:" , gc5
? "ga1 content:" , ga1
? "ga2 content:" , ga2
?
? "Number of PUBLICs at Start() :" , memvar:PublicsCount() // 7 , ok
?
IF File ( "publics.mem" )
RESTORE FROM publics.mem ADDITIVE
? "------------------------------"
? "PUBLICs content after RESTORE"
? "------------------------------"
? "gc1 content:" , gc1
? "gc2 content:" , gc2
? "gc3 content:" , gc3
? "gc4 content:" , gc4
? "gc5 content:" , gc5
? "ga1 content:" , ga1
? "ga2 content:" , ga2
?
? "Number of PUBLICs after RESTORE :" , memvar:PublicsCount() // 7 , ok
? "---------------------------------"
ELSE
?
? "File publics.mem not found"
?
ENDIF
// assign new values
gc1 := "gc1 " + Time()
gc2 := "gc2 " + Time()
gc3 := "gc3 " + Time()
gc4 := "gc4 " + Time()
gc5 := "gc5 " + Time()
SAVE TO publics.mem ALL LIKE gc* // save the gc1 -> gc5 content only.
?
RETURN