the_lord_mephy Posted September 9, 2004 Posted September 9, 2004 Do $letter = InputBox("Enter Character", "Please Enter the character you wish to see the ASCII code for. To end script, enter quit in the box below") $ascii = Asc($letter) If StringLen($letter) >= 2 AND NOT $letter="quit" Then MsgBox(0, "Error", "You typed in more than one character at once") ElseIf StringLen($letter) = 1 Then MsgBox(0, "ASCII", "The ASCII Code for: " &$letter& " is: " &$ascii) EndIf Until $letter = "quit" How come when ever i enter a random letter combonation, it doesnt do the Msgbox that says you typed in more than one character at once My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Matt @ MPCS Posted September 9, 2004 Posted September 9, 2004 Try This: Do $letter = InputBox("Enter Character", "Please Enter the character you wish to see the ASCII code for. To end script, enter quit in the box below") $ascii = Asc($letter) If StringLen($letter) >= 2 AND NOT( $letter="quit" ) Then MsgBox(0, "Error", "You typed in more than one character at once") ElseIf StringLen($letter) = 1 Then MsgBox(0, "ASCII", "The ASCII Code for: " &$letter& " is: " &$ascii) EndIf Until $letter = "quit"
the_lord_mephy Posted September 9, 2004 Author Posted September 9, 2004 thankyou My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
the_lord_mephy Posted September 9, 2004 Author Posted September 9, 2004 is there a way to make it so that if the person clicks cancel it goes away? My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Developers Jos Posted September 9, 2004 Developers Posted September 9, 2004 is there a way to make it so that if the person clicks cancel it goes away? <{POST_SNAPBACK}>Do $letter = InputBox("Enter Character", "Please Enter the character you wish to see the ASCII code for. To end script, enter quit in the box below") If @error = 1 then ExitLoop $ascii = Asc($letter) If StringLen($letter) >= 2 And Not $letter = "quit" Then MsgBox(0, "Error", "You typed in more than one character at once") ElseIf StringLen($letter) = 1 Then MsgBox(0, "ASCII", "The ASCII Code for: " & $letter & " is: " & $ascii) EndIf Until $letter = "quit" SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Matt @ MPCS Posted September 9, 2004 Posted September 9, 2004 @JdeB Did that work for you? I was trying it, but it wasn't working for me. *** Matt @ MPCS
Developers Jos Posted September 9, 2004 Developers Posted September 9, 2004 (edited) @JdeB Did that work for you? I was trying it, but it wasn't working for me. *** Matt @ MPCS <{POST_SNAPBACK}>yeap, works for me... when Cancel is clicked in the InputBox, the loop is exited.... Did you use my code or did you place the @error test at a different line ? Edited September 9, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Matt @ MPCS Posted September 9, 2004 Posted September 9, 2004 Here it is, for some reason the @error has to come before you determine the ascii value: Do $letter = InputBox("Enter Character", "Please Enter the character you wish to see the ASCII code for. To end script, enter quit in the box below") If @error = 1 then ExitLoop $ascii = Asc($letter) If StringLen($letter) >= 2 AND NOT( $letter="quit" ) Then MsgBox(0, "Error", "You typed in more than one character at once") ElseIf StringLen($letter) = 1 Then MsgBox(0, "ASCII", "The ASCII Code for: " &$letter& " is: " &$ascii) EndIf Until $letter = "quit" *** Matt @ MPCS
Developers Jos Posted September 9, 2004 Developers Posted September 9, 2004 Here it is, for some reason the @error has to come before you determine the ascii value: Do $letter = InputBox("Enter Character", "Please Enter the character you wish to see the ASCII code for. To end script, enter quit in the box below") If @error = 1 then ExitLoop $ascii = Asc($letter) If StringLen($letter) >= 2 AND NOT( $letter="quit" ) Then MsgBox(0, "Error", "You typed in more than one character at once") ElseIf StringLen($letter) = 1 Then MsgBox(0, "ASCII", "The ASCII Code for: " &$letter& " is: " &$ascii) EndIf Until $letter = "quit" *** Matt @ MPCS <{POST_SNAPBACK}>@error contains the Error condition of the last function, so it has to come right after the inputbox..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Matt @ MPCS Posted September 9, 2004 Posted September 9, 2004 Yeah i figured that out after looking at the documentation. Thanks for the pointer though. *** Matt @ MPCS
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now