XSharpPublic icon indicating copy to clipboard operation
XSharpPublic copied to clipboard

DBFMEMO/DBFBLOB driver does not allow saving array to dbv

Open cpyrgas opened this issue 1 year ago • 0 comments

Following VO code stores array to dbv file

FUNCTION Start() AS VOID
	LOCAL cFileName AS STRING
	LOCAL blob AS USUAL
	LOCAL a AS ARRAY
	
	cFileName := "c:\test\rdd\dbfblob"
	a := {{1,"two",1.2},{TRUE,FALSE,Today(),#TEST}} 
	
	? DbCreate(cFileName, ,"DBFBLOB")
	
	? DbUseArea(TRUE,"DBFBLOB",cFileName + ".dbv")
	blob := BLOBDirectPut(0,a)
	? blob // NIL in X#
	
	? BLOBRootLock()
	? BLOBRootPut(AsString(blob))
	? BLOBRootUnlock()
	
	DbCloseArea()
	
	? DbUseArea(TRUE,"DBFBLOB",cFileName + ".dbv")
	
	blob := BLOBRootGet()
	a := BLOBDirectGet(Val(blob)) 
	? ALen(a)
	ShowArray(a)
	
	DbCloseArea()

cpyrgas avatar May 14 '24 11:05 cpyrgas