Problem Passing Function as CONST Parameter in Version 3.20

Product Version(s): 3.20
Operating System:   MS-DOS
Flags: ENDUSER | TAR17011 buglist3.20 fixlist3.30
Last Modified: 30-SEP-1988    ArticleIdent: Q10398

The examples below exhibit two problems trying to pass functions as
CONST parameters. In the first example when the function F is enclosed
in a parenthesis in the "copystr" call, it appears as if F is invoked
twice. When the parenthesis is omitted as in the second example, PAS1
emits a compile time error 227 - Invalid address of Function.

Microsoft has confirmed this to be a problem in Version 3.20. This
problem was corrected in Version 3.30.

The example code as is as follows:

Example 1

    PROGRAM PAREN(INPUT,OUTPUT);
       TYPE LSTR_80=LSTRING(80);
       VAR  B_STRING:STRING(4);

       FUNCTION F:LSTR_80;
          BEGIN
           WRITELN('INSIDE FUNCTION F');
           F:='1234';
          END;

    BEGIN {MAIN}
      COPYSTR((F),B_STRING);
      WRITELN(B_STRING);
    END.

Example 2

    PROGRAM PAREN(INPUT,OUTPUT);
       TYPE LSTR_80=LSTRING(80);
       VAR  B_STRING:STRING(4);

       FUNCTION F:LSTR_80;
          BEGIN
           WRITELN('INSIDE FUNCTION F');
           F:='1234';
          END;

    BEGIN {MAIN}
      COPYSTR(F,B_STRING);
      WRITELN(B_STRING);
    END.
