Previous | Next | Table of Contents | Index | Program List | Copyright

CHAPTER 9

Strings and Files


9.1 Data Structures: The String Data Type
9.2 System Structures: String Packages in Ada 95
9.3 System Structures: A Systematic View of Text Files
9.4 Problem Solving: Operating System Redirection of Standard Files
9.5 Problem Solving: Getting Input Values from a String
9.6 System Structures: Reading Command Parameters
9.7 Tricks of the Trade: Common Programming Errors
Chapter Review

This chapter contains two main topics--strings and text files--and shows how they are used, as well as several ways in which they are related.

In this chapter, you will see that a string is just an array of characters and that Ada provides a number of special operations, such as slicing and concatenation, to deal with strings. There are also some standard Ada 95 libraries to deal with character and string translations and variable-length strings.

You will also see more examples of how to use files of data with your programs. You will learn to enter program data from data files and save program output on output files. Using data files frees you from having to reenter test data continually while debugging a program. Using output files enables you to save output on disk rather than to simply view it on the screen. Input and output redirection allows you to specify, on the command line, the names of disk files to be used instead of the keyboard and the screen.

Finally, you will learn about the Ada 95 command line package, which provides a standard way to get input arguments from the operating system command line.


Previous | Next | Table of Contents | Index | Program List | Copyright

Copyright © 1996 by Addison-Wesley Publishing Company, Inc.