by Dr. Peter Wayne
| Alpha Five version 5 is still in the early stages of development, but already v5 is working with the Internet in ways that will make Alpha devotees rejoice! |
Alpha Software just began work on version 5 a few weeks ago, but already Alpha-watchers can discern new power and capability in our trusty workhorse. Some of the features that version 5 will make available are web-specific, and include
We all know that Alpha Five makes great reports, but occasionally you might want to email a report to someone else. If they have the same printer as you do, then you can send the email output to FILE and mail the resulting output to your correspondent, but if they don't have your printer, then there's no way to transmit that output except by sending hard copy. Well, if you can send them a Rich Text Format report, then your email correspondents can open that report and print it on any Windows-supported printer. In addition, by making an RTF file as the report output, you can then open that report in your favorite word processor and modify it before printing it or sending it on.
Similarly, perhaps you would like to place the output of your Alpha Five report on a web site. Currently there's no way to do it, unless you write a complex Xbasic script to include HTML formatting in your output file. However, with A5v5, it will be possible to produce HTML output without any special programming, and you can then take your report and place it on a web site or even email it to anyone with a browser.
If this isn't enough, version 5 adds a new feature that I promise you will knock your socks off! You can use Alpha Five to send and receive email! Version 5 adds a new object to the Xbasic explorer, the email object. The email object has 3 methods:
Let me show you how to use the email object to send and receive email. First, I have a table, sendmail.dbf, with the following structure:

I then created the default form for the table and added 2 buttons, a Send Mail button and a Receive Mail button:

The OnPush script for the Send mail button is fairly straightforward. It tells the Alpha emailer the name of my internet service provider's mail host, gets my password from me, and sends my name and password on to my ISP:
dim shared password as c
mymail=table.current()
if parent.mode_get()<>"VIEW" then
parent.commit()
end if
e=email.open()
e.client_hostname="popd.ix.netcom.com"
e.client_identity="p.wayne@ix.netcom.com"
if password="" then
password=ui_get_password("Alpha Mail",\
"Enter your mail password")
end if
e.client_password=password
e.client_username="p.wayne"
e.mail_hostname="smtp.ix.netcom.com"
e.send_to=mymail.to
e.send_cc=mymail.cc
e.send_subject=mymail.subject
e.send_contents=mymail.body
e.send()
ui_msg_box("email","sent")
Script 1. OnPush script to send email.
And the Read mail button's OnPush script is similar:
dim shared password as c
mymail=table.current()
if parentform.mode_get()<>"VIEW" then
parent.commit()
end if
e=email.open()
e.client_hostname="popd.ix.netcom.com"
e.client_identity="p.wayne@ix.netcom.com"
if password="" then
password=ui_get_password("Alpha Mail",\
"Enter your mail password")
end if
e.client_password=password
e.client_username="p.wayne"
e.mail_hostname="popd.ix.netcom.com"
count=e.receive()
ui_msg_box("You received",alltrim(str(count))\
+" emails")
Of course, you need to have an active internet connection at the time you invoke either one of these scripts. You can think of the possibilities. For example, you could automatically send a confirmatory email whenever an order is shipped. You could even use Alpha Five to email an entire .dbf file from one site to another as an attachment!
Alpha Five version 5 is still in its most preliminary development. You should not assume that email will work exactly as I have sketched it here. Most likely it will be modified before the final release, and the version 5 reference manual will contain examples for its use. But I thought that the web-enabled Alpha Five was so exciting that you would want to know about it as soon as I did! Even though version 5 is in very preliminary development, the email is already working, and I have sent and received emails from a beta version of Alpha 5 v5 using the exact scripts listed above. Congratulations to Alpha for another coup!
4/4/99
Don't forget, we need your feedback to make this site better!