GEOSoft Posted January 18, 2004 Posted January 18, 2004 ; Script Function: ; Convert KB article number to URL ; $a=clipget () StringStripWS ($a,7) If StringLeft ($a,1)="Q" Then $a=StringTrimLeft ($a,1) If StringIsDigit ($a)="0" OR StringLen ($a) <"5" OR StringLen ($a) >"6" Then MsgBox (4096,'Error!!','The clipboard does not appear to contain a valid MS Knowledge Base article number'&@LF&'Please check your selection again and retry.') Exit EndIf ClipPut ('http://support.microsoft.com/?kbid='&$a) MsgBox (4096,'', 'DONE!!',1) Exit I will use Q178238 as the example. If the line contains Q178238 and I double click the number to select it then copy it to the clipboard, the Q should be stripped (it is) and then it is checked to make sure it is a numeric value of either 5 or 6 digits (so far so good). If I add a space to the end of the line and repeat the process, the StringStripWS ($a,7) should be removing the trailing space. This is where it fails. I get the MsgBox (Error) showing instead. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Administrators Jon Posted January 18, 2004 Administrators Posted January 18, 2004 StringStripWS ($a,7) should be: $a = StringStripWS ($a,7) Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
GEOSoft Posted January 18, 2004 Author Posted January 18, 2004 :iamstupid: Duh!!! That probably applied to the other workarounds I tried too. Thanks Jon. By the way can you use multiple conditions in Do....Until or While loops? eg; Do <whatever> Until <condition 1> OR <condition 2> While <condition1> OR <condition2> <whatever routine> Wend George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Lemures Posted January 18, 2004 Posted January 18, 2004 i dont see why not, try it. <condition 1> OR <condition 2> is the same as <condition3> to the computer, and so it would be interpreted as Until <condition 3>. i think. did that make sense?
Administrators Jon Posted January 18, 2004 Administrators Posted January 18, 2004 :iamstupid: Duh!!!That probably applied to the other workarounds I tried too. Thanks Jon.By the way can you use multiple conditions in Do....Until or While loops?eg;Do <whatever>Until <condition 1> OR <condition 2>Yep. JP has done one that's about 5 lines long...for testing purposes Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
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