|
-
Dec 5th, 2000, 10:11 AM
#1
Can you set default values in the definition of your user defined types.
If not, I have created a function that will set all values to desired default values, how can I use this when I user redim preserve on an array of my udt?
-
Dec 5th, 2000, 10:15 AM
#2
PowerPoster
.
Try using enumerated constants or Enums. You just place the definition of the Enum in the declaration section of the form or module:
Code:
Enum Bonus
NoBonus = 0
Standard = 5
Special = 10
End Enum
-
Dec 5th, 2000, 10:34 AM
#3
Thanks, but I don't think that helps.
For example I have a datatype user.
A user has a first name, last name, birthday, number of cars (these are made up fields)... but when I declare a type user
I would like to have some default values in case these are not set (other than the regular default values which may be valid) for example I would like number of cars (an integer) to be set to a negative number. On the declaration above User.NumCars would default to zero but I want it to default to a negative number because 0 may be a valid value but never set and I want to check if it has been set yet.
I am using VB 6 Professional
-
Dec 5th, 2000, 10:36 AM
#4
Frenzied Member
thumbs up to classes..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|