Errata and Omissions

by Dr. Peter Wayne

Inevitably errors and omissions occur in printed documentation. Here I try to list known errors and omissions in Alpha's documentation as well as in the books, Xbasic for Everyone and Learning Alpha Five.

Errors in Learning Alpha Five

Errors in Xbasic for Everyone

Errors in the Xbasic Guide

The missing ODBC .ini files

Errors in Learning Alpha Five

Chapter 17, p. 165: The expression I give for current_balance is incorrect, and gives the wrong value when placed in a subreport. The correct expression is
previous_balance+total(transactions->amount,grp->addressee,grp->Subreport 1:detail)
In retrospect, I realize that putting a subreport in a letter is a tricky proposition, and I would have been better off using a report as a billing statement.
Chapter 29, p. 337: The code that is "borrowed" for the Print Monthly Activity Report consists of these lines:

dim A_ASK_PRINT as c
A_ASK_PRINT = ui_get_radio(this.text, 1, "Print", "Preview")
if A_ASK_PRINT = "Print"
	goto print
elseif A_ASK_PRINT = "Preview"
	goto preview
else
	goto cleanup
end if
print:
:Letter.print("Billing Statement")
goto cleanup
preview:
:Letter.preview("Billing Statement")
goto cleanup
cleanup:
end

The construct this.text in the second line is legal Xbasic in the context of a button but not in a menu. You have to change that line to

A_ASK_PRINT = ui_get_radio("Monthly Activity Report", 1, "Print", "Preview")

You make a similar change for the "Monthly Billing" menu action.

Xbasic for Everyone errors

There were a number of errors in Xbasic for Everyone.

Chapter 19: Ranges. One big issue was that the syntax for ranges changed as the book was being written and Xbasic was being developed. The syntax given on p. 49 is incorrect. It should be
range.index_pointer=index pointer variable

In the scripts given in that chapter, wherever you see range.index you should replace it with range.index_pointer. Or better yet, don't use ranges at all, but use queries, which are incredibly powerful in v3 and v4. I have almost entirely abandoned ranges in favor of queries.

Chapter 20, p. 54:

There is a missing dim statement of
dim query.filter as c

The line that begins
cust.last_name=upper(left(last_name,1))+
should begin
cust.last_name=upper(left(cust.last_name,1))+
Chapter 21, p. 58: The last line of the function at top should read
day_of_year=day-new_year_d+1

Xbasic guide (Adobe Acrobat® format)

I didn't write the Xbasic user guide, and I haven't read the whole manual. This is just a partial list of errors that I have come across in reading parts of the manual. Feel free to email me with errors that you uncover.

p. 70-71, discussion of OnChange event. The sample code given will not work. The flag variable has to be declared as shared. Revised code for the OnArrive event would be:

dim shared flag as L
dim shared init_value as c

and for the OnChange event, the code should begin:

dim shared flag as L
dim shared init_value as c

p. 73, discussion of CanTabChange event. The syntax for referring to the fields on the tabbed page is wrong, in that no property is specified for the fields. The correct code should be
IF :customer_dialog:last_name.text="" then
and
IF :customer_dialog:address.text="" then

p. 231, <file>.create() should be file.create()

The example script shows the correct usage.

p. 147: The table.create_begin()/table.create_end() methods create a new table but do not add the table to your database. To add the table to the database you need to invoke an undocumented Alpha Five method, file_add_to_db().

Syntax: File_add_to_db(table)
Description: Adds the .dbf table to the database (the .adb file) so that the table appears in the Control Panel.
Example:
'This script adds a new table to the Control Panel
file_add_to_db(“c:\Alpha Five\data\customer.dbf”)

ODBC .ini files

Alpha Five version 4's documentation refers to sample .ini files for Oracle and Microsoft SQL server. These files were left off the CD-ROM. I have obtained these files from Alpha Software and am posting them here. Please be aware that I did not write these files and cannot help you debug any ODBC problems you have with these initialization files. However, from looking at these files it is apparent that these files act as a translator to move Alpha Five expressions into SQL expressions and back again.

The ODBC ini files need to go into the WINDOWS directory, not the ALPHA5 directory. The ODBC DSN name, which you can access under Control Panel, 32bit ODBC, is used to determine which INI file to load. So MSSQLSRV.INI will only be loaded by Alpha Five if the ODBC DSN name is MSSQLSRV. If your system calls it "SQL Server" instead, you need to rename the INI file "SQL Server.ini".

Here are the files:

;Mssqlsrv.ini
;       Generic ODBC/SQL 32-bit Driver INI for Alpha Five Client/Server.
;       Copyright (c) 1995-7, Alpha Software Corp., All Rights Reserved.
;
[SQLSyntax]
FieldTypeC=VARCHAR(%d)
FieldTypeD=DATETIME
FieldTypeL=BIT
FieldTypeM=VARBINARY(%d)
FieldTypeN=DOUBLE
FieldName=%s
OrderByArgument=order by @@@1
OrderByString=order by %s
StringDelimiter='
TableDrop=drop table %s
TableCreate=create table %s
TableSelectAll=SELECT * FROM %s
UniqueNot=DISTINCT
Unique=DISTINCT
Where=WHERE
WhereFalse=where 0=1
WhereFalseAnd=where 0=1 and
WhereString=WHERE %s
WhereStringAnd=where %s and
;
;       Syntax for tools.
;
AppendAll=INSERT INTO %s ( %s ) %s SELECT %s FROM %s
AppendReplace=UPDATE %s SET %s FROM %s, %s WHERE %s = %s
AppendUnique=INSERT INTO %s ( %s ) SELECT %s FROM %s, %s WHERE %s NOT IN (SELECT %s FROM %s WHERE %s = %s)
Copy=SELECT %s INTO %s %s FROM %s
Dup=SELECT %s.* INTO %s %s FROM %s
Inter=IN '%s'
Intersect=SELECT %s INTO %s FROM %s, %s WHERE %s = %s
Join=SELECT %s INTO %s FROM %s,%s WHERE %s = %s
MarkRange=DELETE FROM %s
Post=UPDATE %s SET %s FROM %s, %s WHERE %s = %s
Subtract=SELECT %s INTO %s FROM %s, %s WHERE %s<>%s
Update=UPDATE %s SET %s 
[DriverInfo]
Description=Generic Driver for ODBC
[FunctionSyntax]
SmatchIn=smatch(@@@1,@@@2)
SmatchOut= @@@1 like @@@2
SmatchArgs=@@@2='%'->'[%]' @@@2='_'->'[_]' @@@2='*'->'%' @@@2='?'->'_'
NotNullIn=.not.isblank(@@@1)
NotNullOut= @@@1 is not NULL 
NotNullArgs=@@@1='"'->''
NullIn=isblank(@@@1)
NullOut= @@@1 is NULL 
NullArgs=@@@1='"'->''
AndIn=.and.
AndOut= and 
AndArgs=
OrIn=.or.
OrOut= or 
OrArgs=
NotIn=.not.
NotOut= not 
NotArgs=
FIn=.f.
FOut= 0=1 
FArgs=
TIn=.t.
TOut= 1=1 
TArgs=
CONDateIn={@@@1}
CONDateOut= ''@@@1''
CONDateArgs=
UpperIn=upper(@@@1)
UpperOut= upper(@@@1) 
UpperArgs=
LowerIn=lower(@@@1)
LowerOut= lower(@@@1)
LowerArgs=
UtIn=ut(@@@1)
UtOut= upper(rtrim(@@@1))
UtArgs=
AlltrimIn=alltrim(@@@1)
AlltrimOut= ltrim(rtrim(@@@1)) 
AlltrimArgs=
LtrimIn=ltrim(@@@1)
LtrimOut= ltrim(@@@1) 
LtrimArgs=
RtrimIn=rtrim(@@@1)
RtrimOut= rtrim(@@@1) 
RtrimArgs=
TrimIn=trim(@@@1)
TrimOut= rtrim(@@@1) 
TrimArgs=
CDateIn=cdate(@@@1)
CDateOut= convert(varchar(10), @@@1, 112)
CDateArgs=
StrIn=str(@@@1,@@@2,@@@3)
StrOut= str(@@@1,@@@2,@@@3)
StrArgs=
BetweenIn=between(@@@1,@@@2,@@@3)
BetweenOut= @@@1 between @@@2 and @@@3 
BetweenArgs=
SoundexIn=soundex(@@@1)
SoundexOut= soundex(@@@1) 
SoundexArgs=
InvertIn=invert(@@@1)
InvertOut= @@@1 desc 
InvertArgs=
CatIn=+
CatOut= + 
CatArgs=
NotEqualsIn=!=
NotEqualsOut=<>
NotEqualsArgs=
; Oracle.ini
;
;       Generic ODBC/SQL 32-bit Driver INI for Alpha Five Client/Server.
;       Copyright (c) 1995-7, Alpha Software Corp., All Rights Reserved.
;
[SQLSyntax]
FieldTypeC=VARCHAR2(%d)
FieldTypeD=DATETIME
FieldTypeL=BIT
FieldTypeM=VARBINARY(%d)
FieldTypeN=NUMBER(%d, %d)
FieldName=%s
OrderByArgument=order by @@@1
OrderByString=order by %s
StringDelimiter='
TableDrop=drop table %s
TableCreate=create table %s
TableSelectAll=SELECT * FROM %s
UniqueNot=DISTINCT
Unique=DISTINCT
Where=WHERE
WhereFalse=where 0=1
WhereFalseAnd=where 0=1 and
WhereString=WHERE %s
WhereStringAnd=where %s and
;
;       Syntax for tools.
;
AppendAll=INSERT INTO %s ( %s ) %s SELECT %s FROM %s
AppendReplace=UPDATE %s SET %s FROM %s, %s WHERE %s = %s
AppendUnique=INSERT INTO %s ( %s ) SELECT %s FROM %s, %s WHERE %s NOT IN (SELECT %s FROM %s WHERE %s = %s)
Copy=CREATE TABLE %s%s AS SELECT %s FROM %s
Dup=CREATE TABLE %s%s AS SELECT %s.* FROM %s
Inter=@%s
Intersect=CREATE TABLE %s AS SELECT %s FROM %s,%s WHERE %s = %s
Join=CREATE TABLE %s AS SELECT %s FROM %s,%s WHERE %s = %s
Post=UPDATE %s SET %s FROM %s, %s WHERE %s = %s
Subtract=CREATE TABLE %s AS SELECT %s FROM %s,%s WHERE %s<>%s
Update=UPDATE %s SET %s 
MarkRange=DELETE FROM %s
[DriverInfo]
Description=Generic Driver for ODBC
[FunctionSyntax]
SmatchIn=smatch(@@@1,@@@2)
SmatchOut= @@@1 like @@@2
SmatchArgs=@@@2='%'->'[%]' @@@2='_'->'[_]' @@@2='*'->'%' @@@2='?'->'_'
NotNullIn=.not.isblank(@@@1)
NotNullOut= @@@1 is not NULL 
NotNullArgs=@@@1='"'->''
NullIn=isblank(@@@1)
NullOut= @@@1 is NULL 
NullArgs=@@@1='"'->''
AndIn=.and.
AndOut= and 
AndArgs=
OrIn=.or.
OrOut= or 
OrArgs=
NotIn=.not.
NotOut= not 
NotArgs=
FIn=.f.
FOut= 0=1 
FArgs=
TIn=.t.
TOut= 1=1 
TArgs=
CONDateIn={@@@1}
CONDateOut= TO_DATE('@@@1', 'MM-DD-YYYY')
CONDateArgs=
UpperIn=upper(@@@1)
UpperOut= upper(@@@1) 
UpperArgs=
LowerIn=lower(@@@1)
LowerOut= lower(@@@1)
LowerArgs=
UtIn=ut(@@@1)
UtOut= upper(rtrim(@@@1))
UtArgs=
AlltrimIn=alltrim(@@@1)
AlltrimOut= ltrim(rtrim(@@@1)) 
AlltrimArgs=
LtrimIn=ltrim(@@@1)
LtrimOut= ltrim(@@@1) 
LtrimArgs=
RtrimIn=rtrim(@@@1)
RtrimOut= rtrim(@@@1) 
RtrimArgs=
TrimIn=trim(@@@1)
TrimOut= rtrim(@@@1) 
TrimArgs=
CDateIn=cdate(@@@1)
CDateOut= TO_DATE('@@@1', 'YYYY-MM-DD')
CDateArgs=
StrIn=str(@@@1,@@@2,@@@3)
StrOut= TO_CHAR(@@@1)
StrArgs=
BetweenIn=between(@@@1,@@@2,@@@3)
BetweenOut= @@@1 between @@@2 and @@@3 
BetweenArgs=
SoundexIn=soundex(@@@1)
SoundexOut= soundex(@@@1) 
SoundexArgs=
InvertIn=invert(@@@1)
InvertOut= @@@1 desc 
InvertArgs=
CatIn=+
CatOut= + 
CatArgs=
NotEqualsIn=!=
NotEqualsOut=<>
NotEqualsArgs=

If you have more errata or omissions that you would like included on this site, please send me Email with a description of the error and the correction.

last revised 1/3/99

Don't forget, we need your feedback to make this site better!

Return to home