[lazarus] "Variant" variable ?
Michael Van Canneyt
michael.vancanneyt at wisa.be
Thu Apr 27 06:11:25 EDT 2000
On Thu, 27 Apr 2000, Marc Weustink wrote:
> + From: michael@[195.207.84.152] [mailto:michael@[195.207.84.152]]On
> + Behalf Of Michael Van Canneyt
> +
> + On Thu, 27 Apr 2000, Marc Weustink wrote:
> +
> + > Is there a check on this? I allways thought that 1 and 2 are just
> + > placeholders?
> +
> + There is no check; you must do the check. The point is that
> + there are 2 constructs
> +
> + Case A : Integer of
> + 1 : (X : String;);
> + 2 : (Y : Longint);
> + end;
> +
> + Here you can set A and thus have an indication which of X or
> + Y you should access. (i.e. A is a normal field of the record)
>
> Ah, as I thought. A is like a reminder for you as developer which filed to
> use.
Yes. And in the Variant, this is used to determine the type of the currently stored
value.
Michael.
More information about the Lazarus
mailing list