iceberg Posted July 18, 2006 Share Posted July 18, 2006 hi, can somepls kindly assist me to "rephrase" this code? $var1 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device") $var2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device") $var3 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device") If $var1 = ("Lexmark Optra T614 (MS),winspool,LPT1:") Or $var2 = ("Lexmark Optra T612 (MS),winspool,LPT1:") Or $var3 = ("Lexmark T632,winspool,LPT1:") Then thanks. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
GaryFrost Posted July 18, 2006 Share Posted July 18, 2006 (edited) many ways to do this, guess it's what the users preference is, here's a couple: $var1 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device") If $var1 = ("Lexmark Optra T614 (MS),winspool,LPT1:") Or _ $var1 = ("Lexmark Optra T612 (MS),winspool,LPT1:") Or _ $var1 = ("Lexmark T632,winspool,LPT1:") Then oÝ÷ Û .ÙÞyÖÞµ§è®Øb²Þjëh×6 Global $a_printers[3] = ["Lexmark Optra T614 (MS),winspool,LPT1:","Lexmark Optra T612 (MS),winspool,LPT1:","Lexmark T632,winspool,LPT1:"] $device = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device") For $x = 0 To UBound($a_printers) - 1 If $a_printers[$x] = $device Then ; do something here ExitLoop EndIf Next Edited July 18, 2006 by gafrost 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...
iceberg Posted July 18, 2006 Author Share Posted July 18, 2006 thanks for the reply gafrost. jus wondering what does the number 3 stands for in Global $a_printers[3]? is it the number of printers? mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 18, 2006 Moderators Share Posted July 18, 2006 He created an array, that's the number of elements that are in the array... for more information.... You can look at the help file for array or take a look here: http://en.wikipedia.org/wiki/Array 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...
bluebearr Posted July 18, 2006 Share Posted July 18, 2006 This will work with the stable release: $a_printers = "|Lexmark Optra T614 (MS),winspool,LPT1:|Lexmark Optra T612 (MS),winspool,LPT1:|Lexmark T632,winspool,LPT1:|" $device = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device") If StringInStr($a_printers, "|" & $device & "|") Then _DoSomething() EndIf BlueBearrOddly enough, this is what I do for fun. Link to comment Share on other sites More sharing options...
iceberg Posted August 7, 2006 Author Share Posted August 7, 2006 thanks guys, works perfectly. mouse not found....scroll any mouse to continue. 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