View Single Post
Old 03-24-2005, 08:25 PM   #1 (permalink)
hyowza
Registered User
 
Join Date: Mar 2005
Posts: 1
hyowza is on a distinguished road
Converting char to string?

Hi,

i've been trying to figure this out, i've read a few related methods and classes in the API and searched google... i don't know if it's possible but i have a method validkey(char key) if a users inputted key is valid the key must be all upper case characters (ASCII value between 65 and 90). I've written a loop which checks if the key is greater '>' than char(65) and less than char(90) then it is valid.

Now here's the problem...when i pass the variable 'char key' through the valid key method the users enters it it and it works but the problem is that it only accepts 1 character (hmmm not a very good password is it? although i do understand the concept of a char being only one character) but what i want is at least 10 character places in uppercase is it possible to have 10 characters in one char declaration?

What i thought is if i converted the passed string to a char this would allow me to check if the key is valid and the user can enter a password which is a string value and then i'll just be able to check if it's valid through the validkey method (it will accept it once it's converted to a char). Any suggestions?
hyowza is offline   Reply With Quote