469,126 Members | 1,276 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,126 developers. It's quick & easy.

how to use enumeration

chandru8
145 100+
Hi to all.

Expand|Select|Wrap|Line Numbers
  1. Public Type hogan_cumn_buff
  2.     Idtype As String * 2
  3.     Idno As String * 16
  4.     Maincountry As String * 6
  5.     Residence As String * 2
  6.     Hometel As String * 8
  7.     Hometelext As String * 4
  8.     Pagerno As String * 8
  9.     Pagerext As String * 4
  10.     Officetel As String * 8
  11.     Officetelext As String * 4
  12.     Mobileno As String * 12
  13.     Action As String * 1
  14.     Remarks(1 To 40) As String
  15. End Type
  16.  
In this type I have to assign a value by default, but I know it's not possible. Is there any way to assign a value?

Thanks
Jan 3 '08 #1
2 1019
Killer42
8,435 Expert 8TB
Perhaps you should be looking at using a class rather than a user-defined data type.

However, if you do want to do it this way, perhaps you could simply invoke a function to create any new occurence, and the function would fill in any appropriate defaults.

Which is kind of a vastly simplified version of a class, of course. :-)
Jan 4 '08 #2
QVeen72
1,445 Expert 1GB
Hi,

When you declare a Variable with the above type, all the String inside the type will be Initialized to Blank String..

To Assign some value, use this code:

Expand|Select|Wrap|Line Numbers
  1. Dim TempVar As hogan_cumn_buff
  2. TempVar.Idtype ="AA"
  3. TempVar.Idno ="XYZZ"
  4. TempVar.Maincountry ="INDIA"
  5. ' And SO On...
  6.  

Regards
Veena
Jan 4 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Justin Wright | last post: by
8 posts views Thread by aevans1108 | last post: by
2 posts views Thread by Mark | last post: by
4 posts views Thread by Marshal | last post: by
1 post views Thread by Stefano G. | last post: by
3 posts views Thread by Davidoff | last post: by
reply views Thread by news.emn.fr | last post: by
3 posts views Thread by eXt | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.