Re: Delphi.NET
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Tue, 26 Jun 2007 18:52:00 -0500
Tom de Neef wrote:
In a traditional Pascal sense you could use a variant record:
TTestRec = record
case proper: boolean of
true: ( t1: array [1..32] of char; t2: array [1..28] of char);
false: (test : array[1..60] of byte);
end;
Daniel gave one reason that won't work -- .Net doesn't work that way. Another reason that won't work is that the two parts of the variant record aren't the same size. Char is a 16-bit type in .Net.
If you must have one-byte characters, use AnsiChar. If you must have two-byte characters, use WideChar. If you _don't care_ what size your characters are, use Char.
--
Rob
.
- References:
- Delphi.NET
- From: Daniel Hobson
- Re: Delphi.NET
- From: Tom de Neef
- Delphi.NET
- Prev by Date: Re: Accessing the sectors of an harddisk
- Next by Date: Re: Delphi.NET
- Previous by thread: Re: Delphi.NET
- Next by thread: Re: Delphi.NET
- Index(es):
Relevant Pages
|