Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: Problem with functions in pascal...

New Message Reply About this list Date view Thread view Subject view Author view

Stephen Edwards (edwards@CS.VT.EDU)
Thu, 15 Feb 2001 09:04:57 -0500


Message-ID:  <3A8BE209.1578818@cs.vt.edu>
Date:         Thu, 15 Feb 2001 09:04:57 -0500
From: Stephen Edwards <edwards@CS.VT.EDU>
Subject:      Re: Problem with functions in pascal...

daward6@VT.EDU wrote:

> FUNCTION intarray ( t_list, s_list : ARRAY OF INTEGER ) : ARRAY OF INTEGER;

I am not sure why this is not working, but be aware that this
is a non-standard extension provided by FreePascal (and Delphi),
and is not part of the ISO Standard. You can read Section 8.3
of the FreePascal reference manual for s bit more info.

Normally, in Pascal, the array bounds are considered part of the
type of an array, and one would typically declare a type:

    type MyArray = array [1..20] of integer;

Then you can use this type as the type of any arguments to
procedures or functions. This will work fine in all versions
of Pascal.

                                -- Steve

--
Stephen Edwards            604 McBryde Hall          Dept. of Computer Science
e-mail      : edwards@cs.vt.edu           U.S. mail: Virginia Tech (VPI&SU)
office phone: (540)-231-5723                         Blacksburg, VA  24061-0106
-------------------------------------------------------------------------------


New Message Reply About this list Date view Thread view Subject view Author view

Home  |   Notes  |   Languages  |   Programs  |   Homework
copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Class site maintained by Stephen H. Edwards <edwards@cs.vt.edu>