Solved

Combination of Capital letter, small letter, number and speacial character

Posted on 2000-03-19
8
576 Views
Last Modified: 2012-06-27
how to detect the input (Text box) that user key in the word (string) are combination of Capital letter, small letter, number and speacial character?
0
Comment
Question by:tonyckx
[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
  • 7
8 Comments
 
LVL 1

Accepted Solution

by:
sadcock earned 60 total points
ID: 2634016
Tonyckx-

Are you trying to detect wether the user pressed all of these keys at once?  Or in a series with each other?

If it is in a series, simply write code in the change event that interrogates the value of the textbox.

i.e.

private function textbox1_change()
   dim required(4) as integer
   dim x as long
   for x = 1 to len(textbox1.text)
      if mid(textbox1.text,x,1) = specchar then
         required(1) = 1
      else
         if mid(textbox1.text,x,1) = captial then
            required(2) = 1
         else
            if mid(textbox1.text,x,1) = lower then
               required(3) = 1
            else
               if mid(textbox1.text,x,1) = number then
                  required(4) = 1
               end if
            end if
         end if
      end if
   next

   If all required's are 1 then
      success
   else
      fail
   end if


P.s.  You would check for number, special char, etc...by using the ASC function against each character to get the ASCII value
0
 

Author Comment

by:tonyckx
ID: 2637044
Can you tell me how to check whether the input is specchar , captial ,lower and number.  Thanks
0
 

Author Comment

by:tonyckx
ID: 2647663
Adjusted points from 30 to 50
0
Independent Software Vendors: 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!

 

Author Comment

by:tonyckx
ID: 2647664
sadcock,
i use a textbox to give user key in  string of character.  when user click command button, a algorithm will check the input textbox. so how i want to write a algorithm to check the input are combination of Capital letter, small letter, number and speacial character? example if the input is:-
1)abcde (boolean = false because small letter only.)
2)1234  (boolean = false because number only)
3)!@#$  (boolean = false because special character only)
4)abc!@#123 (boolean = false because no capital letter)
5)!@#TonyCKX123 (boolean = true) combination of Capital letter, small letter, number and speacial character

can you give me some coding about the situation? thanks very much.

from tonyckx
0
 

Author Comment

by:tonyckx
ID: 2665029
Adjusted points from 50 to 60
0
 

Author Comment

by:tonyckx
ID: 2665030
sadcock,
How to detect a input of string contain a special character? Example

1)tonyckx!123 (Boolean = true)
2)computer (Boolean = false)
3)Nesw$ (Boolean = true)

pls help me!

Thanks.
0
 

Author Comment

by:tonyckx
ID: 2843616
Comment accepted as answer
0
 

Author Comment

by:tonyckx
ID: 2843618
Thanks sadcock.

from u comment, i get sulotion to solve my problem.

Thanks very much!

from
Tonyckx
0

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.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 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