Sign in to follow this  
Followers 0
relaxteb

how to get an exclamation mark "!" in a string

10 posts in this topic

Hi,

I am quite a newbee with autoIt.

However i am eager into learning it.

Now i run against the problem where i can't put an "!" in a string.

In my case, i have an password input box where i want to put the password "password!!!!!".

This does not work, when i display the string it only shows the "password" part.

How can i solve this ?

regards,

Sebastian

Share this post


Link to post
Share on other sites

Have you checked the Helpfile since its explained in there and there is a table showing all special characters/keys....

check for the Send() command :D


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Have you checked the Helpfile since its explained in there and there is a table showing all special characters/keys....

check for the Send() command :D

Hi Jos,

Yes i have checked the helpfiles.

But in my case, it is hard to use that command.

I am trying to have a password input box which writes into a string.

Should i then convert the string to seperate asci characters and send them 1 by 1 ?

Or is there a more easy way to accomplish this ?

gr

Sebas

Share this post


Link to post
Share on other sites

@relaxteb...you can also do this by using ControlSetText()...Like this...

$passwd = InputBox("Security Check", "Enter your password.", "", "*")
ShellExecute("Notepad")
WinWait("Untitled - Notepad","")
ControlSetText("Untitled - Notepad","","Edit1",$passwd)
WinActivate("Untitled - Notepad")

Share this post


Link to post
Share on other sites

I'm pretty sure Jos was hinting that to send a literal exclamation point you have to use Send({!})

Share this post


Link to post
Share on other sites

I'd like to do the same thing in order to make one of my scripts more user-friendly (make the keys that require {}s to not need them). If the InputBox could change when the user gives a "!", "?", etc., then it would be much easier for users to type, rather than having to find out how and when to use the pointy brackets.

Share this post


Link to post
Share on other sites

MsgBox(0,"",_PrepareSend("Yes!#^#"))
Func _PrepareSend($sString)
    $array = StringSplit("!+^#", "")
    For $X = 1 to $array[0]
        $sString = StringReplace($sString, $array[$X], "{" & $array[$X] & "}")
    Next
    Return $sString
EndFunc

Share this post


Link to post
Share on other sites

Thank you for the help.

Share this post


Link to post
Share on other sites

solved it by using the tips.

tnx !

sebas

Share this post


Link to post
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
Sign in to follow this  
Followers 0