MEMVARs, PUBLICs etc.

This forum is meant for questions and discussions about the X# language and tools
User avatar
Chris
Posts: 4926
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

MEMVARs, PUBLICs etc.

Post 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!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

MEMVARs, PUBLICs etc.

Post 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
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

MEMVARs, PUBLICs etc.

Post 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

Attachments

[The extension viaef has been deactivated and can no longer be displayed.]

Post Reply