[V4RB] BLOB problems
Ken Jordan
jordan at digi-net.com
Tue Nov 1 14:35:31 CST 2005
I have a very small program to test storing and retrieving binary data
using a VBlob. (2.0.4 - OS X.3.9)
app.open:
---------------
Valentina.Init(10 * 1024 *1024)
Valentina.DebugLevel = 3
Valentina.ThrowExceptions = true
Window1.PushButton1.Action:
-------------------------
dim f as FolderItem = GetFolderItem("vtest.vdb")
if f.Exists then f.Delete()
dim test_database as VDatabase = new VDatabase
test_database.Create(f, 1, 32 * 1024, EVOs.kOSDefault )
dim file_table as VTable = test_database.CreateTable("ftable")
call file_table.CreateBLOBField( "file", 1024 )
f = GetFolderItem("file.rar")
file_table.BlobField("file").FromFile(f)
f = GetFolderItem("saved_file.rar")
file_table.BlobField("file").ToFile(f)
test_database.Close()
test_database = nil
app.Close:
-----------------------
Valentina.Shutdown()
file.rar is a 1.8 MB rar containing Valentina examples.
Two problems:
1) "diff file.rar saved_file.rar" yields "Binary files file.rar and
saved_file.rar differ"
Stuffit will open file.rar, will not open saved_file.rar
2) Program crashes at test_database.Close()
Any ideas what I am missing??
TIA,
Ken
More information about the Valentina
mailing list