X-Sharp / XSharpPublic

Public repository for the source code for the XSharp Compiler, Runtime, Project System and Tools.
Apache License 2.0
89 stars 36 forks source link

DBFMEMO/DBFBLOB driver does not allow saving array to dbv #1465

Open cpyrgas opened 1 month ago

cpyrgas commented 1 month ago

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()