
>From bin  Thu Jun 17 13:34:56 1999
Received: from ujf.ujf-grenoble.fr (ujf.ujf-grenoble.fr [193.54.232.33])
	by spectro.ujf-grenoble.fr (8.9.1a/8.8.5) with ESMTP id NAA11138
	for <lombardi@spectro.ujf-grenoble.fr>; Thu, 17 Jun 1999 13:34:48 -0100
From: richard.kerry@quantel.com
Received: from tvweb1.hiway.co.uk (tvweb1.hiway.co.uk [195.12.1.131])
	by ujf.ujf-grenoble.fr (8.8.5/8.8.5) with ESMTP id NAA05058
	for <Maurice.Lombardi@ujf-grenoble.fr>; Thu, 17 Jun 1999 13:27:44 +0200 (MET DST)
Received: from mailsrv.quantel.com (bin@quantel-gw.hiway.co.uk [195.12.5.195])
	by tvweb1.hiway.co.uk (8.9.2/8.8.7) with ESMTP id MAA16302
	for <Maurice.Lombardi@ujf-grenoble.fr>; Thu, 17 Jun 1999 12:27:32 +0100 (BST)
Received: SMTP by Quantel-Mailhub (8.8.3/3.1). id MAA07637
          for INET:Maurice.Lombardi@ujf-grenoble.fr Thu, 17 Jun 1999 12:25:17 +0100
To: Maurice Lombardi <Maurice.Lombardi@ujf-grenoble.fr>
Message-ID: <80256793.003D13F2.00@buffer1.HQ.quantel>
Date: Thu, 17 Jun 1999 12:29:52 +0100
Subject: Re: GPC BUG: Initializer for tagged variant records does not work
Mime-Version: 1.0
Content-type: text/plain; charset=us-ascii
Organization: Quantel Ltd.


Oregon Pascal doesn't have initializers as such, but it does have
structured constants. The syntax for assigning structured constants would
be :

type
  t = record
     f1 : integer;
     case tag : integer of
       0: (i : integer);
       1: (r : real);
     end;
var
  r_int, r_real : t;

begin
r_int := (1, 0, (42));
r_real := (1, 1, (3.14));
end.

Ie. The variant part looks like another record nested within the main one
and the tag appears as a normal field.

Helpfully,
Richard.

PS.
type
  t = record
     f1 : integer;
     case 0 .. 1 of
       0: (i : integer);
       1: (r : real);
     end;
Would also work using the same assignment syntax, and saves space in the
record as there's no actual tag field.



