Article View: comp.lang.misc
Article #2705Order of declarations
From: Erland Sommarskog
Date: Sat, 12 Jan 1991 12:39
Date: Sat, 12 Jan 1991 12:39
28 lines
1509 bytes
1509 bytes
Also sprach Dr A. N. Walker (anw@maths.nott.ac.uk):
>For example, in C, you have a
>good chance of getting a procedure and everything you need to know
>to understand it onto one screen; in Pascal, this is very frequently
>impossible, both because of the verbosity of Pascal and because of the
>restrictions on order of declaration;
Thankfully many Pascal compilers lift this restriction and
allow you to declare entities in arbitrary order. If I
have a function within another functions I usually write
something like:
FUNCTION Nisse(A : integer) : integer;
VAR Global : char;
FUNCTION Kalle(B : integer) : char;
VAR Local : char;
BEGIN
... Global ...
END;
VAR Local : char;
...
You still can't declare a variable in the beginning of a new
block like in Ada or Simula, though.
--
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
"There is only one success -- to be able to spend your life in your own way"
Christopher Morely
Technical Details
Message-ID:
<2385@enea.se>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!usc!julius.cs.uiuc.edu!apple!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!enea!sommarReferences:
<1990Dec29.101233.1894@mathrt0.math.chalmers.se> <18747:Jan220:02:1091@kramden.acf.nyu.edu> <1991Jan4.152846.15917@maths.nott.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!usc!julius.cs.uiuc.edu!apple!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.misc Subject: Order of declarations Message-ID: <2385@enea.se> Date: 12 Jan 91 12:39:09 GMT References: <1990Dec29.101233.1894@mathrt0.math.chalmers.se> <18747:Jan220:02:1091@kramden.acf.nyu.edu> <1991Jan4.152846.15917@maths.nott.ac.uk> Organization: Enea Data AB, Sweden Lines: 28