Variant Record Types

  • Thread starter Thread starter Michael D. Ober
  • Start date Start date
M

Michael D. Ober

Can VB.Net create variant record types similar to C Unions? If so, how?

Thanks,
Mike Ober.
 
Not quite. Here's an example from VMS Basic:

RECORD FOO
VARIANT
CASE
STRING BUF = 10

CASE
STRING FIRST_5 = 5
STRING LAST_5 = 5
END VARIANT
END RECORD

In the sample above, FIRST_5 will return and/or set the first 5 characters
of BUF and LAST_5 will return and/or set the last 5 characters of BUF.
Since I'm porting from VMS to VB 6, which doesn't support this construct
easily, and now to VB.Net, I was hoping for a cleaner solution than I had to
implement in VB 6.

Mike Ober.
 
Back
Top