* Problem with string() in Pascal
@ 1996-12-05 5:00 Stuart Palin
0 siblings, 0 replies; only message in thread
From: Stuart Palin @ 1996-12-05 5:00 UTC (permalink / 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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-12-05 5:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-12-05 5:00 Problem with string() in Pascal Stuart Palin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox