The following is an example of a simple wysiwyg text editor written in Ada. The editor commands are:
@@ mas1.ada @@ +WITH Ada.Text_io; +USE Ada.Text_io; +PROCEDURE main IS +BEGIN + put("Hello world"); new_line; +END main; @@ mas2.ada @@ +WITH Ada.Text_io; +USE Ada.Text_io; +PROCEDURE main IS +BEGIN + put("Another program"); new_line; +END main;
ArchiverThe archive is created by the program: |
De-archiverThe files are extracted from the archive by the program: |
The line @@ mas1.ada @@ specifies the file to which the following text is to be written to. Each line of extracted text has a + as its first character which is removed before the line is written to the file.
The source code held in this archive format for the all the programs used in this book, is available using anonymous FTP at the URL address ftp://ftp.brighton.ac.uk/pub/mas/ada95 . Alternatively the files are accessed using the WWW URL http://www.brighton.ac.uk/ada95/programs/home.htm
Pages on the World Wide Web are written using the HTML markup language. The markup tags control in part the format of the displayed information that a browser of the page will see.
Normally the web page displayed will simply contain information which the reader of the page will view. However, it is possible to let the viewer return information to a server for processing. For example, to search for information on a particular topic. The input that the viewer returns is sent to a server which invokes a CGI (Common Gateway Interface) script to process the transaction. After processing the CGI script returns a web page constructed using HTML which will be displayed to the viewer.
On the server the environment variable QUERY_STRING contains the data sent. The CGI script can then extract this information from the environment variable and construct a suitable web page as a reply.
A program in Ada 95 to dynamically create a web page that contains the contents of the environment variable QUERY_STRING is cgi_qs.ada.
A program to decode the data held in the environment variable QUERY_STRING is described in CGI parse program