Skip to main content
main-content

Über dieses Buch

i.I Who Should Use This Book? Despite all that has been written about programming languages, there seems to be a no­ ticeable weakness-a scarcity of good material for beginners. Beginners could be those who would like to learn how to prbgram, but have never done it before. Or beginners could be those new to a particular programming language. Many programming language books and tutorials seem to assume that the reader has some prior experience, or that there is some sort of instructor present who can explain all the details that the tutorial leaves out. This book, however, is written with the intention of making the learning experience for novices as painless as possible. I have tried to keep my assumptions about prior knowledge to a minimum-although, as with anything, some assumptions need to be made. I do assume that the reader has minimal knowledge about how to use a computer (typing in text, selecting menu items-that sort of thing). This book is not just for those who have never programmed, but also for program­ mers new to the Algol/Pascal "family" of languages. Since many general concepts are foreign to those fluent in other programming languages, and problems are often ap­ proached in a different manner, even experienced programmers might want a basic and straightforward explanation of language structures.

Inhaltsverzeichnis

Frontmatter

Introduction

Introduction

Abstract
Despite all that has been written about programming languages, there seems to be a noticeable weakness—a scarcity of good material for beginners. Beginners could be those who would like to learn how to program, but have never done it before. Or beginners could be those new to a particular programming language.
Eric W. Nikitin

Procedures

Frontmatter

Chapter 1. Using Procedures

Abstract
As stated in the introduction, procedures are a list or block of instructions or statements that the programmer wishes the computer to follow. A programmer uses procedures to solve problems and get the computer to perform actions. Procedures can be used as general-purpose routines and are often given arguments—values that change with each procedure call.
Eric W. Nikitin

Chapter 2. Values and Type

Without Abstract
Eric W. Nikitin

Chapter 3. Writing Procedures

Without Abstract
Eric W. Nikitin

Chapter 4. Variables and Changing Values

Without Abstract
Eric W. Nikitin

Chapter 5. Using Modules

Abstract
Module In comes with most Oberon compilers, just like module Out. However, module In can be just a little bit trickier to work with than module Out.
Eric W. Nikitin

Chapter 6. Expressions and Function Procedures

Abstract
Expressions represent or show a value; like everything in Oberon, all expressions have a type. The simplest expressions are literal values. Variables are also expressions.
Eric W. Nikitin

Chapter 7. The FOR Statement

Abstract
One of the things that computers do very well is execute repetitious tasks. That is, actions that are done over and over again—possibly with some slight variation each time through the “loop.” Statements that make actions repeat are called loops. Another word that means the same as looping is iteration.
Eric W. Nikitin

Chapter 8. The IF Statement

Abstract
Sometimes we want things to happen within our programs, depending on certain conditions or states that occur during execution. That is, we want to be able to make choices in our programs. When a program executes a set of statements only under certain conditions, it is called conditional execution or branching.
Eric W. Nikitin

Chapter 9. Other Looping Statements

Abstract
There are three looping statements discussed in this section: WHILE, REPEAT, and LOOP. Oberon has many different types of looping statements for a reason. Each one is tailored to specific situations and makes those situations easier to read, write, and understand.
Eric W. Nikitin

Chapter 10. The CASE Statement

Abstract
Although we could use IF for all situations involving conditional execution—that is, making decisions or choosing alternatives—Oberon provides another statement that helps to simplify certain situations.
Eric W. Nikitin

Types

Frontmatter

Chapter 11. Working with Types

Abstract
Type describes data and defines what operations are permitted on values. Type information helps the compiler decide which values can be assigned to variables.
Eric W. Nikitin

Chapter 12. Array Types

Abstract
We have been using one kind of array for quite a while now—ARRAY OF CHAR. But so far, a lot of the details have been left out about what it means to be an array.
Eric W. Nikitin

Chapter 13. Record Types

Abstract
Records are a way of packaging related information together. Records are invaluable for creating abstractions. We can group information together, rather than just treat data as a series of unrelated numbers and letters.
Eric W. Nikitin

Chapter 14. Extending Record Types

Abstract
Type extension provides us with another way to “layer” modules. Type extension allows the programmer to extend an existing record type by adding new fields. In Oberon, the “new” extended type is still compatible with the “old” base type.
Eric W. Nikitin

Chapter 15. Pointer Types

Abstract
The concept of a pointer is, in essence, a very simple notion. However, pointers are often a great source of confusion for novice programmers. So, unlike other chapters, we will start off here with a discussion before seeing an example.
Eric W. Nikitin

Chapter 16. Uses of Pointers

Abstract
Because pointer types are such an important part of the Oberon language, and the fact that many people initially find pointers to be confusing, a separate chapter is provided on some of the more common and appropriate uses for pointers. Later in chapter 19 on type-bound procedures, we will see another important use of pointers.
Eric W. Nikitin

Chapter 17. Sets

Abstract
This may seem an odd place to discuss one of Oberon’s basic types; after all, we talked about all the other basic types toward the beginning of the book. Sets serve some unique purposes in Oberon, and so this topic deserves enough attention to warrant a separate chapter.
Eric W. Nikitin

Type-bound Procedures

Frontmatter

Chapter 18. Objects

Abstract
Thus far in this book, we have demonstrated the use of modular design when writing programs. Discussion on abstraction and encapsulation were intended to show how to effectively use Oberon’s module construct to this end.
Eric W. Nikitin

Chapter 19. Type-bound Procedures

Abstract
We have seen how types and procedures work together—types describe information and procedures describe the actions performed on that information. Up to this point, the main way to tie procedures to the information was as arguments to the procedure.
Eric W. Nikitin

Chapter 20. Additional Topics

Abstract
If you have ever browsed the shelves in the computer section of your local bookstore, you couldn’t possibly have any illusions that this one book would cover all there is to know about programming.
Eric W. Nikitin

Backmatter

Weitere Informationen