473,324 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Variant Record Types

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

Thanks,
Mike Ober.
Nov 20 '05 #1
3 1772
Hi Michael,

You mean this?

http://msdn.microsoft.com/library/de...ndatatypes.asp

I hope this helps?

Cor
Nov 20 '05 #2
Hi,

Use Structure instead of Type.
http://msdn.microsoft.com/library/de...mStructure.asp

Ken
----------------

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl:
Hi Michael,

You mean this?

HYPERLINK
"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/ht
ml/vbconcreatingyourowndatatypes.asp"http://msdn.microsoft.com/library/defau
lt.asp?url=/library/en-us/vbcon98/html/vbconcreatingyourowndatatypes.asp

I hope this helps?

Cor


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #3
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.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uk**************@TK2MSFTNGP09.phx.gbl...
Hi,

Use Structure instead of Type.
http://msdn.microsoft.com/library/de...mStructure.asp
Ken
----------------

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl:
Hi Michael,

You mean this?

HYPERLINK
"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/ht ml/vbconcreatingyourowndatatypes.asp"http://msdn.microsoft.com/library/defau lt.asp?url=/library/en-us/vbcon98/html/vbconcreatingyourowndatatypes.asp

I hope this helps?

Cor


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew S. Giles | last post by:
Helo all, I have a standalone unmanaged C++ application that makes a call on another standalone COM server, which raises an event that should be handled in C#. I am trying to send: unsigned...
3
by: Martin | last post by:
Hi, I'm a beginner. Is there type VARIANT in C#? I use my class dbTextbox (which inherited from Textbox) to store and display diferent values type from database. Therefore I want to create...
19
by: Jon Davis | last post by:
Hi guys! Just wanted to let you all know that I created a Variant structure, inspired by the old VB6 days. This is written in C#, but you can build a CLR/.NET class library assembly and reference...
9
by: Ulrich Hobelmann | last post by:
Hi, slowly transitioning from C to C++, I decided to remodel a struct/union (i.e. type identifier as first field, union of variant types) as a class + subclasses. Switching functions are replaced...
7
by: Tracks | last post by:
I have old legacy code from vb5 where data was written to a file with a variant declaration (this was actually a coding error?)... in vb5 the code was: Dim thisdata as integer Dim thatdata...
8
by: Mark Williams | last post by:
Hi all, Im being supplied data from shared memory in the format of VARIANT's. Ive been searching through MSDN and Google for quite a long time now and i cannot find how these should be used in...
1
by: morten | last post by:
When i compile this code in VC71 or VC80 i get the following errors: The code is copy/paste from the boost.org tutorial. Please help! error C2039: 'begin' : is not a member of...
3
by: empire5 | last post by:
I'm trying to convert a MS-Sql 6.5 VB application to SQL 2005 and vb.net. The vb app has uses a variant data type. When I try to read the variant data type from the sql 2005 database I get 8,000...
1
by: captainc | last post by:
I have C++ code to import a .tlb and use a .dll that has functions that return VARIANT types and accepts BSTRs (bstrings). I have seen that python has modules that can manipulate VARIANTs and BSTRs...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.