• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

Creating simple object


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
vbRetard
Asked:
vbRetard
  • 2
1 Solution
 
tkuppinenCommented:
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
 
vbRetardAuthor Commented:
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
 
tkuppinenCommented:
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
 
MarineCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now