Solved

Creating simple object

Posted on 2000-03-30
4
126 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 15 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

631 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