Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 11th, 2003, 11:02 AM
Authorized User
 
Join Date: Jun 2003
Location: Livermore, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Project.Class.Property. ?

Ok. For instance ADO has
ADODB.RECORDSET.Field.Value

Adodb is the project, Recordset is the Class, Field is the property, what is Value? Sub Property?

I want to add a Size property associated to my Name Property inside my class. (So you get the . List in vb when you use the Name Property)

How do I do this?
Reply With Quote
  #2 (permalink)  
Old June 11th, 2003, 11:10 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

ADODB.RECORDSET.Field returns an object as the result of the property. VB is smart when you say .VALUE and says "hey, lets get the object and then take that and do a .value to it)

it's like doing this:
Code:
myField = ADODB.Recordset.Field("FieldName")
myValue = myField.Value
Now, I am not sure why you would want a size property- as Name is likely to be of type String. String in itself is an object and you can use the name object and use .length on the string to find out it's length.

Hal Levy
Daddyshome, LLC
Reply With Quote
  #3 (permalink)  
Old June 11th, 2003, 11:12 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I just realized this is VB- not VB.NET...

In that case use len(myName) and get the length of the string.

Hal Levy
Daddyshome, LLC
Reply With Quote
  #4 (permalink)  
Old June 11th, 2003, 01:37 PM
Authorized User
 
Join Date: Jun 2003
Location: Livermore, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I just used Name for instance.
I have a class that sends messages. Each message has its own set of rules for each property. IsRequired, MaxLength, DataType.

I want the application to be able to test the data going into the class before it gets there, based on the rules (or properties) for each property.
For instance:
dim myClass as new Transactions.NewMessage
if MyClass.MessageBody.IsRequired then
  if len(MyVariableGoingToClass) <> MyClass.MessageBody.MaxLength then error
end if

Some other properties may have a SubRoutine associated to that property, Like:
MyClass.MessageBody.Build()

So when you look at the entire hierarchy, you see:
Transactions.NewMessage.MessageBody.Build()

How would I do that?
Reply With Quote
  #5 (permalink)  
Old June 11th, 2003, 03:10 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Depends on the design and the language.. In .NET
One way is create a method .build() on the messagebody class... The messagebody class could be a class inherited from string, so you only need to make your one method.

The MyClass.MessageBody property would return a MessageBody Object.

Hal Levy
Daddyshome, LLC
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Why no UserID property in the Membership class mega ASP.NET 2.0 Professional 0 August 16th, 2006 02:01 AM
Get all property values of class rrhandle ASP.NET 1.0 and 1.1 Basics 1 January 12th, 2006 05:13 PM
Access to a property in the class. AyatKh ASP.NET 1.0 and 1.1 Basics 2 December 18th, 2003 11:25 AM
Project.Class.Property.? Jstmehr4u3 Pro VB 6 2 June 11th, 2003 11:29 AM



All times are GMT -4. The time now is 04:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.