Chapter 12: Programming Examples
129
box between the Company Greeting mailbox (990) and the Instruction mailbox (991)
as follows:
This configuration now changes Amanda’s standard processing and keeps the caller
connected to the correct language Instruction mailbox. It works because whenever a new
call is answered, Amanda initializes the %S tokens to "" (the empty string). Therefore, if
the caller never presses 1 for Spanish, then %S1 is never set to the value "SPANISH" and
control is always passed on to mailbox 991 from mailbox 992.
Order Shipment Information
This example illustrates how you can interact with data files to retrieve useful information
that is given to callers by request.
Application
The application is as follows:
1.
Ask the caller to enter an order number (let’s assume that it is five digits).
2.
Determine whether or not the corresponding order has shipped.
3.
If the order has not shipped, inform the caller. Otherwise, tell the caller the date the
order was shipped.
In order for Amanda to determine an order’s shipped status and its ship date, she needs to
retrieve information from some source. One possible way she can obtain the data is by
using the serial, S(), token to request it from another computer. An alternative solution is
to access the information by looking in a file on Amanda’s hard disk (or alternatively, a
network server if Amanda is connected to one). For this example, we use the second
implementation and assume that the following files exist on Amanda’s hard disk in the
root directory:
SHIPPED - An ASCII text file with order numbers that have been shipped (one per line),
for example:
Summary of Contents for [email protected] Version 3.xx
Page 1: ...Installing AmAndA Work Place Version 3 xx Installer s Guide Edition 7 01...
Page 4: ...iv Installing Amanda Work Place...
Page 60: ...52 Installing Amanda Work Place...
Page 68: ...60 Installing Amanda Work Place...
Page 132: ...124 Installing Amanda Work Place...
Page 150: ...142 Installing Amanda Work Place...
Page 156: ...148 Installing Amanda Work Place...
Page 194: ...186 Installing Amanda Work Place...
Page 206: ...198Installing Amanda Work Place...