Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating simple object

Posted on 2000-03-30
4
Medium Priority
?
127 Views
Last Modified: 2013-11-25

HI all, I am trying to learn object oriented techniques in vb. I know the
question i am asking is probably very easy one but neverthe less i need help
with it. Let's say i want to design a method in my class that will do validations.
Say i want to see if the textboxes are all field. So i create a isComplete()
method. So in my form i then call this method and pass parameters to it.
ex. Set oCheck = New iCheck
     oCheck.isComplete text1,text2
end example...
but right after i call oCheck method i need to call another method let's
call it Register. But if isComplete returns that not all textboxes have been
filled i don't want to call Register method. How do i do that ?

I was suggested to do this. But i did't understood what the property Varified meant. Here is what the person suggested.
4 options (not mutually exclusive) out of probably many, many more:
1. make "IsComplete" a function and return a boolean for success:
      If oCheck.IsComplete(text1.text,text2.text) Then
2. Add a "Verified" property to the object:
      Call oCheck.IsComplete(Text1.Text,Text2.Text)      If oCheck.Verified Then
3. Raise an error in the IsComplete routine if it fails and use Error
Trapping in the client
4. Raise an event in the IsComplete routine and set a flag in the client

I would appriciate any feedback
0
Comment
Question by:vbRetard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
tkuppinen earned 45 total points
ID: 2670328
These are all valid approaches but the simplest one is probably number 1.  Numbers 3 and 4 are just too much work for something like this.
0
 

Author Comment

by:vbRetard
ID: 2670334
Ok here is a bit more information. After i call isComplete method i pass there values 4 values to be exactly. The values are seen if they are filled. Then i need to use another method isPws to see if passwords match. Then if they do i need to call another method which will send that information into a database. Does any one understand what i mean ? Please provide some help. Thanks a lot.
0
 
LVL 1

Expert Comment

by:tkuppinen
ID: 2670390
A little more info please.  Is this just a "login" type screen?  Do you just want to check for a value that exists in a database ?
0
 
LVL 6

Expert Comment

by:Marine
ID: 2670546
can  you just explain me how i can this done ? This is not for a login screen. This is going to be later update the information into a database. This is just for my understanding of classes. I want to create an object that will use isComplete event that will check to see if textboxes are emtpy. I have no problem there. I create that method and pass the values to that event. Then i make it return True | False if its empty or not. Then i use isPws method to see if passwords are exact. If they are i then call another method that will write that info taken from the textboxes into a database. All this is going to be for registration screen. I would appriciate your help a lot on this. I have more ideas on this but i don't know if i will be able to express them correctly. Thanks again for the help.

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question