Originale-mail to me for new edition

 

Array parameters

 

When you declare routines that take array parameters, you cannot include index type specifiers in the parameter declarations. That is, the declaration

procedure Sort(A: array[1..10] of Integer);   // syntax error

causes a compilation error. But

type TDigits = array[1..10] of Integer;

procedure Sort(A: TDigits);

is valid. For most purposes, however, open array parameters are a better solution.

 

Topic groups

 

See also

Parameters: Overview

Procedures and functions: Overview

Variant open array parameters

 

 

译文

 

数组参数

 

声明接受数组参数的例程时,不能在参数声明中包括索引类型说明。简言之,下面的声明

procedure Sort(A: array[1..10] of Integer);   //语法错误

将导致编译错误。而下面的声明

type TDigits = array[1..10] of Integer;

procedure Sort(A: TDigits);

则是有效的。然而,对于大多数用途,开放数组参数是较好的解决办法。

 

主题组

 

相关主题

参数:概述

过程和函数:概述

变体开放数组参数