Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Stuart Palin <stuart.palin@gecm.com>
Subject: Problem with string() in Pascal
Date: 1996/12/05	[thread overview]
Message-ID: <586fd6$ihs@gcsin3.geccs.gecm.com> (raw)


{ VAX/VMS PASCAL compiler problem with string()
     PASCAL v4.4-89 on
     VMS 5.5         - yes I know it is way out of date but we have to
                       baseline our development environment!
     Overview
        The schema definition, and documentation, suggests that string()
        and varying [] of char are equivalent; and recommends that
        string () be used for portability!

        In several instances we have had problems when using string() that
        go away when using varying [] of char.  Below is an example that
        casues the compiler to crash with an internal error!

     Question
        Can anyone provide some insight into what is going on?  (We can
        usually find work-arounds once we realise what is causing the
        problem).
--
    Stuart Palin
    stuart.palin@gecm.com
}
program TEST(output);

  type
    REC_A = record
      { The two should be equivalent but are not! }
      S : string(16);            { Causes problem }
     {S : varying [16] of char;  { No problem }
    end;

  { A nonsense procedure that illustrates a problem,
    note that the parameters need to be independently
    declared! }
  procedure Test_1(P : REC_A := [otherwise zero];
                   Q : REC_A := [otherwise zero]);
  begin
     { Just something to fill the space }
     writeln(P.S);
     writeln(Q.S);
  end;
 
begin
  Test_1;
  { Compiler crashes here with :
%PASCAL-F-SENDSPR, Internal Compiler Error
%PASCAL-I-SENDSPR, while processing routine TEST at line 38
                   during Code Selection
%PASCAL-F-ENDDIAGS, PASCAL completed with 1 diagnostic
  }
end.




                 reply	other threads:[~1996-12-05  5:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox