[Gambas-user] Release of gambas 1.9.23

Benoit Minisini gambas at ...1...
Mon Jan 2 02:21:29 CET 2006


Happy new year to everyone! (Well... for those who have the same calendar than 
me)

Here is a new release of the development version:

The main change in this version is the support for auto-increment and blob 
fields in the database component.

To create a serial field, use the 'db.Serial' constant as field datatype. And 
to create a blob field, use the 'db.Blob' constant.

Because of underlying database limits, you can only have one autoincrement 
field by table, and it must be the primary key.

Moreover, the blob support is not perfect: it uses SQL requests, and so wastes 
memory and CPU. Especially in the sqlite driver, which have many problems 
about that...

A blob field returns a Blob object, which have a Data property, that 
represents the blob data as a string. There is a Length property too, that 
returns the length of the blob data.

The returned Blob object is valid as long as you don't move or release the 
Result object it comes from.

Here is a little example:

	res = DB.Find("MyTable")
	PRINT res!BlobField.Data
	res!BlobField.Data = File.Load("picture.png")
	' The following is a shortcut for the previous line
	res!BlobField = File.Load("picture.png")

The following drivers were modified to support autoincrement fields and blobs:
 * MySQL
 * PostgreSQL
 * SQLite

ODBC and Firebird driver do not support it yet. I will post some explanation 
about what to do in the development mailing-list for Niggel, Andrea and 
Daniel

Otherwise, there are many other little changes you will see in the ChangeLog.

The more important is that now you can declare several local variables of the 
same datatype on the same line. This way:

	DIM i, j, k AS Integer

Maybe I should allow this syntax too:

	DIM i AS Integer, s, a AS String

I will see if it is possible...

So... try it and report the problems... :-)

-- 
Benoit Minisini





More information about the User mailing list