czardas Posted September 14, 2006 Share Posted September 14, 2006 I would like to give examples of symbols that are to be avioded in the naming of documents. The following symbols should be avoided. * ? / \ " and so on. But I cannot avoid the script reading the speech marks. I only want the script to deliver the message, in the form of a msgbox with an OK button. Maybe I'm asking too much! operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 14, 2006 Moderators Share Posted September 14, 2006 I would like to give examples of symbols that are to be avioded in the naming of documents. The following symbols should be avoided. * ? / \ " and so on. But I cannot avoid the script reading the speech marks. I only want the script to deliver the message, in the form of a msgbox with an OK button. Maybe I'm asking too much!Asking too much? Doubtful!Explaining correctly? Also Doubtful, because I have no idea what you're asking.You can check for the chars, and make a conditional statement to not allow them... You can use StringInStr() to find them, and or StringReplace() to just get rid of them all together. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
czardas Posted September 14, 2006 Author Share Posted September 14, 2006 $text = InputBox("SECRET SCRIPT", "Choose a name for the file. Do not use any of the following chartacters: / \ : < > * ? |") operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 14, 2006 Moderators Share Posted September 14, 2006 $text = InputBox("SECRET SCRIPT", "Choose a name for the file. Do not use any of the following chartacters: / \ : < > * ? |")OK? and... the rest of the story? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted September 14, 2006 Share Posted September 14, 2006 $text = InputBox("SECRET SCRIPT", "Choose a name for the file. Do not use any of the following chartacters: / \ : < > * ? |") If _IsBadName($text) Then MsgBox(0,"Invalid", "FileName Character(s)") Exit EndIf MsgBox(0,"Valid", "FileName: " & $text) Func _IsBadName($s_Name) Local $Ilegal_chars[9] = ['\', '/', ':', '*', '?', '"', '<', '>', '|'] Local $x For $x = 0 To UBound($Ilegal_chars) - 1 If StringInStr($s_Name, $Ilegal_chars[$x]) Then Return 1 Next Return 0 EndFunc ;==>_IsBadName SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
czardas Posted September 14, 2006 Author Share Posted September 14, 2006 The rest of the story is that I want to say $text = InputBox("SECRET SCRIPT", "Choose a name for the file. Do not use any of the following chartacters: / \ : < > * ? | or "") The speech marks don't appear in the InputBox. Which is a small problem. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
czardas Posted September 14, 2006 Author Share Posted September 14, 2006 Thanks UDF Maniac. I'll see what that does:~) operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 14, 2006 Moderators Share Posted September 14, 2006 The rest of the story is that I want to say $text = InputBox("SECRET SCRIPT", "Choose a name for the file. Do not use any of the following chartacters: / \ : < > * ? | or "") The speech marks don't appear in the InputBox. Which is a small problem.by speach marks do you mean double quote marks? $text = InputBox("SECRET SCRIPT", 'Choose a name for the file. Do not use any of the following chartacters: / \ : < > * ? | or "') Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
czardas Posted September 14, 2006 Author Share Posted September 14, 2006 Speech marks, double quote marks, yes. Sorry typing's bad. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
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