Download Ada in Action

Transcript
Contents
3
2.11.3. USE Clauses ...............................................................................................44
Chapter 3. I/O UTILITIES................................................................................................................46
3.1. ASCII_UTILITIES package .........................................................................................46
3.1.1. IMAGE Attribute ........................................................................................46
3.1.2. Qualified Expressions..................................................................................48
3.1.3. VALUE Attribute........................................................................................49
3.1.4. Short Circuit Control Forms........................................................................50
3.1.5. Character Conversions ................................................................................51
3.1.6. Ada Strings .................................................................................................51
3.2. MONEY_UTILITIES package .....................................................................................53
3.3. TEXT_IO package .......................................................................................................55
3.3.1. What's Wrong With TEXT_IO....................................................................55
3.4. VIRTUAL_TERMINAL package.................................................................................56
3.4.1. Guaranteed Functionality ............................................................................56
3.4.2. Information Hiding .....................................................................................57
3.4.2.1. Alsys VIRTUAL_TERMINAL body...........................................57
3.4.2.2. Meridian VIRTUAL_TERMINAL body.....................................58
3.4.3. Visual Attributes .........................................................................................58
3.4.4. VIRTUAL_TERMINAL Uses .....................................................................58
3.5. SCROLL_TERMINAL package ...................................................................................59
3.5.1. Reusability and Consistency ........................................................................59
3.5.2. Layering......................................................................................................59
3.5.3. SCROLL_TERMINAL Features..................................................................59
3.5.4. Compatibility ..............................................................................................60
3.5.5. Hiding Details in the Package Body.............................................................60
3.5.6. Coupling .....................................................................................................60
3.5.7. Module Partitioning ....................................................................................62
3.5.8. Limited Name Space ...................................................................................62
3.5.9. The Top is at the Bottom.............................................................................63
3.6. FORM_TERMINAL package.......................................................................................64
3.6.1. When to use the FORM_TERMINAL .........................................................64
3.6.2. Consistency.................................................................................................65
3.6.3. Abstract Objects ..........................................................................................65
3.6.4. Exception Handling.....................................................................................67
3.6.5. Keep Shared Variables Hidden....................................................................72
3.6.6. Reuse by Copy.............................................................................................72
3.6.7. Global Variables .........................................................................................73
3.6.8. A Package Can be an Abstract Object..........................................................73
3.6.9. Discriminated Records ................................................................................73
3.6.10. Reading Discriminated Records from a File.................................................77
3.6.11. Discriminants May Not Save Space.............................................................78
3.6.12. Use Read as a Pattern for Write...................................................................79
3.6.13. ASCII Data Files.........................................................................................80
3.6.14. Storing Boolean Values in a File .................................................................80
3.6.15. One Compilation Unit Per File ....................................................................81
3.6.16. Encapsulating Details in One File ...............................................................81
3.6.17. Formatted I/O..............................................................................................82
3.6.18. The Danger of Improvement .......................................................................82
3.6.19. Creating a New FORM................................................................................83
3.6.20. Character Substitution.................................................................................84
3.6.21. Long Strings ...............................................................................................85
3.6.22. IN OUT Mode.............................................................................................85
3.6.23. Editing an Existing FORM..........................................................................87
3.6.24. null Exception Handlers ..............................................................................87
Ada in Action