Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Difference between ENTRY and EXTERNAL ENTRY in PL/1

1,417 views
Skip to first unread message

Satish Talamanchi

unread,
Aug 26, 2009, 12:39:12 AM8/26/09
to
Hi

I have some subroutines declared in my PL/1 program as below.

DCL RPFREAD ENTRY(*,*);
DCL RPFOPEN ENTRY(*);
DCL SGMGS EXTERNAL ENTRY(*,*);

Can any one explain the difference between Entry and External Entry
statements in PL/1?

Thanx
Sati

Tim E. Sneddon

unread,
Aug 26, 2009, 3:01:25 AM8/26/09
to

There is no difference. The EXTERNAL attribute is implied when
declaring an ENTRY constant. The flip-side is the VARIABLE
attribute which allows the declared name to be assigned, eg.

DECLARE E ENTRY VARIABLE;
DECLARE A ENTRY EXTERNAL;
DECLARE B ENTRY;

E = A;
CALL E;

E = B;
CALL E;

Tim.

glen herrmannsfeldt

unread,
Aug 26, 2009, 4:12:07 AM8/26/09
to
Tim E. Sneddon <tim.s...@bigpond.com> wrote:
(snip)


< There is no difference. The EXTERNAL attribute is implied when
< declaring an ENTRY constant. The flip-side is the VARIABLE
< attribute which allows the declared name to be assigned, eg.

< DECLARE E ENTRY VARIABLE;
< DECLARE A ENTRY EXTERNAL;
< DECLARE B ENTRY;

I think you are right, but isn't VARIABLE a relatively
recent addition to PL/I? Without it, is it possible to
declare ENTRY variables at all? If so, are there almost
ambiguous cases?

-- glen

John W Kennedy

unread,
Aug 26, 2009, 2:44:00 PM8/26/09
to

Back in the (F) days, internal entries were also supposed to be
declared, even though it was obviously redundant.

Also, there have always been such things as entry parameters.

Entry variables came in in 1970 as part of the Optimizer/Checker generation.

glen herrmannsfeldt

unread,
Aug 26, 2009, 3:10:30 PM8/26/09
to
John W Kennedy <jwk...@attglobal.net> wrote:

< Back in the (F) days, internal entries were also supposed to be
< declared, even though it was obviously redundant.

< Also, there have always been such things as entry parameters.

< Entry variables came in in 1970 as part of the Optimizer/Checker generation.

Somehow I thought they were earlier. Did they have Fortran 66 style
(through 95) ENTRY name as procedure argument, but that you could
only call and not assign? That wouldn't be ambiguous.

-- glen

James J. Weinkam

unread,
Aug 26, 2009, 3:30:49 PM8/26/09
to

The PROCEDURE statement defines an ENTRY constant, which is an entry point for
that procedure, for each name that appears in its label prefix.

The ENTRY statement defines an ENTRY constant, which is an entry point for the
innermost procedure in which it appears, for each name that appears in its
label prefix.

An external procedure is not contained in any other procedure of begin block
but may be within a package. An internal procedure is nested in one or more
containing procedure or begin blocks (at least one of which is necessarily a
procedure since BEGIN statements must occur within a procedure.).

The scope of all entry constants defined for a procedure is the block in which
the procedure is immediately contained if the procedure is internal; otherwise
an entry constant has external scope.

The ENTRY attribute may be used within a DECLARE statement to define an entry
variable within the block in which the declaration appears or to specify the
attributes of the parameter(s) and returned value (if any) of an external
entry constant invoked from within the block in which the declaration appears.

John W Kennedy

unread,
Aug 26, 2009, 11:03:55 PM8/26/09
to

Yes.

robin

unread,
Aug 27, 2009, 1:38:04 AM8/27/09
to
"glen herrmannsfeldt" <g...@ugcs.caltech.edu> wrote in message
news:h72qon$4ch$1...@naig.caltech.edu...

It has always been possible to declare ENTRY,
and to use procedure names as arguments.


robin

unread,
Aug 27, 2009, 1:38:06 AM8/27/09
to
"glen herrmannsfeldt" <g...@ugcs.caltech.edu> wrote in message
news:h741b6$g4h$1...@naig.caltech.edu...

> John W Kennedy <jwk...@attglobal.net> wrote:
>
> < Back in the (F) days, internal entries were also supposed to be
> < declared, even though it was obviously redundant.
>
> < Also, there have always been such things as entry parameters.
>
> < Entry variables came in in 1970 as part of the Optimizer/Checker
> generation.
>
> Somehow I thought they were earlier.

Now you're contradicting youself. A few hours ago,
you said that you thought that they were a recent addition.

> Did they have Fortran 66 style
> (through 95) ENTRY name as procedure argument, but that you could
> only call and not assign? That wouldn't be ambiguous.

Procedure (ENTRY) names have always been acceptable as arguments.


CG

unread,
Aug 29, 2009, 11:51:00 PM8/29/09
to

You are mostly correct. In the specific example, E is not required to
be EXTERNAL. In fact, most of the time I would expect E to be INTERNAL.
This does not exclude the E=B; assignment. And the eventual CALL E
[even though E is INTERNAL] would actually call B, the EXTERNAL ENTRY.

Maybe a bit confusing, but this is one of the distinctions between a
VARIABLE and a 'constant'.
--
Carl

0 new messages