Errata sheet for "A Beginner's Guide to Gambas" last updated 16 Oct 05 by John Rittinghouse

All items below this line have been corrected and are incorporated in the new document dated 16 Oct 05.
-------------------------------------------------------------------------------------------------------

Errata sheet for "A Beginner's Guide to Gambas" last updated 14 Oct 05 by John Rittinghouse

Page 126 	change sStringLength to iStringLength as shown below:

STATIC PUBLIC SUB Main()
 DIM iStringLength AS Integer
 DIM sTestString AS String

 sTestString = "12345678901234567890"
 sStringLength = Len(sTestString)
 PRINT "==> " & iStringLength & " is the length of our test string."

 sTestString = "12345"
 iStringLength = Len(sTestString)
 PRINT "==> " & iStringLength & " is the length of our test string."

 sTestString = "12345678901"
 iStringLength = Len(sTestString)
 PRINT "==> " & iStringLength & " is the length of our test string."
END

----------------------------------------------------------------------------------------------

Page 334	change the Edit section to this:

	The Edit method returns a read/write Result object used for editing records in the specified table.  Query is equivalent to an embedded SQL WHERE clause used for filtering the table, and the Arguments are quoted as needed by the SQL syntax and substituted in the Request string (like in sscanf in C) as we explained previously.  Standard calling convention is: 

FUNCTION Edit ( Table AS String [ , Query AS String, Arguments AS , ... ] ) AS Result

Here is a code sample to show how Edit() works:

DIM MyResult AS Result
DIM sQuery AS String
DIM iParm AS Integer

sQuery = "id=&1" 
' we will insert a parameter value (12) at the end of the query string
iParm = 12

$hConn.Begin
MyResult=$hConn.Edit("tblDEFAULT", sQuery, iParm)
MyResult!Name = "Mr Rittinghouse" ' Set a field value
$hConn.Update ' Update with the new value
$hConn.Commit ' make the changes permanent
$hConn.Close  ' close the database connection

----------------------------------------------------------------------------------------------

