uppersoul Posted April 17, 2009 Share Posted April 17, 2009 Switch $SSvalue Case 0,2,4,6,8,10,12,14;0000/0010/0100/0110/1000/1010/1110 ;enter if LSB is zero and does not limit to 4 bits The code's comment explain most of what i wanted to do, but the above method is hardcoding, any suggestion on how to go about doing this that is not hardcoding another question would * is a wildcard character for fileinfile, what i need is a wildcard integer so that it would also work like the above for the sequence 1 2 4 8 .... eg: Case(*wildcard int*)^2 ; 0-255 thankyou in advance Link to comment Share on other sites More sharing options...
andybiochem Posted April 17, 2009 Share Posted April 17, 2009 For soft-coding multiple conditions I'd load the conditions into an array, then test the array for the value: #include <Array.au3> Global $aConditions[8] = [0,2,4,6,8,10,12,14] $iValue = 4 If _ArraySearch($aConditions,$iValue) <> -1 Then MsgBox(0,"","Value meets the required conditions") ...the conditions can then be changed by manipulating the array. - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar! Link to comment Share on other sites More sharing options...
uppersoul Posted April 17, 2009 Author Share Posted April 17, 2009 (edited) its still quite the same, i wanted a range because just in case the conditions is at like example 1111110 a 7 bit condition but thank you, it would really help if there is a wild int i can use or something that represents 1-100 will do as well was hoping for something like this case 2^(0 to 100) ;LOL i would prefer something that enables me to detect its MSB or LSB of a string/int because my condition is base on the integer's bit flag being 0 or 1 Switch $SSvalue Case 0,2,4,6,8,10,12,14;0000/0010/0100/0110/1000/1010/1110 ;enter if LSB is zero and does not limit to 4 bits thank you Edited April 17, 2009 by uppersoul Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 17, 2009 Share Posted April 17, 2009 If BitAND($SSvalue, 1) = 0 Then ... Perhaps? WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
uppersoul Posted April 19, 2009 Author Share Posted April 19, 2009 If BitAND($SSvalue, 1) = 0 Then ...Perhaps?WBDThank you WBD, it might just do the trick, working on it right now. Thanks again 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