By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,336 Members | 2,315 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,336 IT Pros & Developers. It's quick & easy.

how to use enumeration

chandru8
100+
P: 145
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
Share this Question
Share on Google+
2 Replies


Expert 5K+
P: 8,434
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
Expert 100+
P: 1,445
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.