Solved

Creating simple object

Posted on 2000-03-30
4
121 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
  • 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now