![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Advanced Visual Basic Techniques
AppointmentBooks help pages are fairly short so the words are linked only to the documents. If the pages were very long, the words could be linked to specific locations within the documents using anchors such as the following: <A HREF=Document.HTM#word_location>key word</A> This would let the user jump directly to the words exact locations. Because Index.HTM is a fairly long document, it begins with a list of the letters A through Z. Each of these letters is linked to the location within this file where index entries starting with the corresponding letter begin. For example, if the user clicks on the letter N, the browser scrolls so the entries beginning with N are visible. The body of Index.HTM begins by defining these links. The following code defines the link to the location N later in the document: <A HREF=#N>N</A> Next the file creates the index entries themselves. Each lettered section begins with the definition of the locations name within the file. For instance, the following code defines the location N. The text is bold so it stands out from the index entries. <A NAME=N><B>N</B></A> The file uses preformatted text for every index entry. This makes it easier to align entries that share a common prefix word or phrase. For example, consider the following code:
date,
<A HREF=MonthA.htm>containing an appointment</A>
<A HREF=MonthA.htm>selected</A>
<A HREF=MonthA.htm>selecting</A>
This code produces the following output:
date,
containing an appointment
selected
selecting
Some letters such as Q have no index entries. Omitting those letters from the list at the top of the file could be confusing. It would also make it more difficult to add entries to those categories later. To allow the user to select these unused letters, locations are defined for them within the document. Location Q is defined just before location R. To properly define a location, its anchor tags must include some text. Because no visible text is needed here, the tags include a single space character. If the user clicks on the Q link at the top of the page, the browser scrolls down to display this space character. Because that character is immediately before the entries beginning with the letter R, those entries will be displayed. The following code shows how the Q and R locations are defined in Index.HTM: <A NAME=Q><B> </B></A> <!-- Entries starting with Q --> <A NAME=R><B>R</B></A> <!-- Entries starting with R --> <A HREF=Overview.htm>reminder</A> The code below shows pieces of Index.HTM. The file repeats several steps 26 timesonce for each letter in the alphabet. To save space, most of the duplicated steps have been removed. You can find the complete HTML code in the Ch3\HelpHTML directory on the compact disk.
<HTML>
:
<!-- HEAD, BODY, etc. omitted -->
:
<!-- Jumps to lettered sections -->
<A HREF=#A>A</A>
<A HREF=#B>B</A> :
<A HREF=#Z>Z</A>
<!-- The index entries -->
<PRE><A NAME=A><B>A</B></A> <!-- Entries starting with A -->
<A HREF=Menus.htm>about AppointmentBook command</A>
appointment,
<A HREF=Purge.htm>data, purging</A>
<A HREF=Modify.htm>deleting</A>
<A HREF=CtxAppt.htm>display</A>
<A HREF=Make.htm>entries, making new</A>
<A HREF=CtxAppt.htm>information</A>
<A HREF=Modify.htm>modifying</A>
<A HREF=MonthA.htm>selecting date</A>
<A HREF=Menus.htm>appointments menu</A>
<A NAME=B><B>B</B></A> <!-- Entries starting with B -->
<A HREF=MonthA.htm>black date</A>
:
<-- Other entries omitted -->
:
<A NAME=P><B>P</B></A> <!-- Entries starting with P -->
<A HREF=Overview.htm>parts of AppointmentBook</A>
<A HREF=Menus.htm>purge command</A>
<A HREF=Purge.htm>purging old appointment data</A>
<A NAME=Q><B> </B></A> <!-- Entries starting with Q -->
<A NAME=R><B>R</B></A> <!-- Entries starting with R -->
<A HREF=Overview.htm>reminder</A>
<A HREF=Review.htm>reviewing appointments</A>
<A HREF=Purge.htm>removing old appointment data</A>
:
<-- More entries omitted -->
:
</PRE>
</BODY>
</HTML>
SummaryThis chapter on AppointmentBook demonstrates several useful programming techniques. It shows how to use the model/view/controller paradigm to manage complex interactions, and how an application can display large amounts of data. It also demonstrates API functions thata program can use to create rotated fonts and to present nonrectangular screens. These features are easy to implement and they make an application stand out from the crowd. Similar techniques are used by programs throughout the rest of the book.
|
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-1999 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permision of EarthWeb is prohibited.
|