13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Programs, procedures, and functions are simply Pascal blocks withheadings and endings. The outline of a program isprogram headingblockperiodThe outline of a procedure or function isprocedure or function headingblocksemicolonThis combination is called a procedure or function definition. Note how itpermits nesting: the block that is contained within any program, procedure,or function can include its own procedure or function definitions. Here, forexample, is the outline of a procedure nested within another procedure:outer procedure headingouter block:declarationsprocedure definition:nested procedure headingnested block:declarationscompound statementsemicoloncompound statementsemicolonProgram Units, finally, are special features of Apple Pascal. A ProgramUnit is compiled from a separate source text, like a program, but cannot beexecuted by itself. Instead it contains declarations, procedures, andfunctions that can be used by any number of programs or other ProgramUnits. A program accesses a Program Unit with a USES declaration,which is written just after the program heading. The USES declarationallows it to use data and routines in the Program Unit as if they were part ofthe program's source text. Program Units and USES declarations are fullydescribed in Chapter 12.III-12Chapter 2: Program Structure

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!