From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,a462a1b0121cb848,start X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,a462a1b0121cb848,start X-Google-Attributes: gid1164f8,public From: Stuart Palin Subject: Problem with string() in Pascal Date: 1996/12/05 Message-ID: <586fd6$ihs@gcsin3.geccs.gecm.com>#1/1 X-Deja-AN: 202490215 content-type: text/plain; charset=us-ascii organization: GEC Marconi Avionics Ltd. mime-version: 1.0 newsgroups: comp.os.vms,comp.sys.dec x-mailer: Mozilla 1.2 (Windows; I; 16bit) { 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.