Jump to content

Input Box


Recommended Posts

Ok i want to make a little "username//password" to tinker with for later use. The only problem is that im not sure of how to make a minimum amount of characters for a username or a password. The only thing the Au3 helpfile has is how to make a maximum amount of characters for the box. So if somone can help me with making a minimum to a username//password i'd really appreciate it. Oh and if somone could show me how to have it so it saves the username//password for later use or just creates a log file with the username and password that would be appreciated to :) .

Example of what im trying to do.

_________________________________________________________________

|_Login_Screen_____________________________________________-_|_|_X_|

|

|Username:

|_________________________________

||________________________________|

|

|Password:

|_________________________________

||________________________________|

|________________________________________________________________

I want to be able to enter the Username: and Password: and the next time I open this the Username will be there and i also want it to have a min of 6 chars and max of 14 for the Username and 6-10 chars for the password. If somone could even start me off with the code to this i'd REALLY REALLY REALLY appreciate it.

[quote]I don't like to think, Therefore I ChEaT[/quote]

Link to comment
Share on other sites

Thnx saunders, ill check out GuiCtrlRead() and StringLen(), And for you layer, ive checked up and down for the "How to make a minimum amount of characters" section and they dont have one... no but I have searched for it, and there is no help on how to do so. Ill try some stuff out and if im still stuck ill come back and tell you where im stuck if necessary oh and 1 quick simple question. i have an .au3(a) thats used to open another .au3(:) that will open yet another .au3©, but in doing so .au3(:evil: and .au3© cannot have functions in them. Can i use GUICtrlCreateButton("") on .au3(:D and have the code for it on .aue(a)?

Edited by LineageIIC3Freak

[quote]I don't like to think, Therefore I ChEaT[/quote]

Link to comment
Share on other sites

Thnx saunders, ill check out GuiCtrlRead() and StringLen(), And for you layer, ive checked up and down for the "How to make a minimum amount of characters" section and they dont have one... no but I have searched for it, and there is no help on how to do so. Ill try some stuff out and if im still stuck ill come back and tell you where im stuck if necessary oh and 1 quick simple question. i have an .au3(a) thats used to open another .au3(:) that will open yet another .au3©, but in doing so .au3(:evil: and .au3© cannot have functions in them. Can i use GUICtrlCreateButton("") on .au3(:D and have the code for it on .aue(a)?

<{POST_SNAPBACK}>

as for the minimum chars thing... it's super easy, but you have to write your own check because it's not a parameter that can be set on the control. a simple check would be something like this:

while 1

$input = InputBox("Type something.","Type something and it better be long enough...")

if stringlen($input) > 3 then exitloop

WEnd

msgbox(0,"Good job",stringlen($input) & " was enough characters")

as far as saving and loading values, that's very simple with registry entries, ini files, or even plain text files. look in the help file for instructions on doing those. and if you want to call a function that is in another .au3 file, you have to #include the .au3 file you want to call into in the code for the .au3 file you want to call from... while you're looking up the registry/ini/text file stuff, do a check on #include also... looking all of that stuff up should only take you a minute or two

Edited by cameronsdad
Link to comment
Share on other sites

There are some flags in InputBox that get added to the end of the password field. Check out the docs in the beta for details, but the features existed in the InputBox that is in the latest release, just undocumented.

In short, adding an M at the end of the password character says that at least one character needs to be returned. Adding a number, like "10" at the end of the password would cause it to max out at ten characters and prevent input after that.

For example, a password string of " M8" (not the space at the beginning of the string) would say that there is not password character (display the characters that are typed), input is manditory (must return at least one character), and to limit the input size to 8 characters.

I do not believe this behaviour has been duplicated in GUI edit controls, as I did not write that feature.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...