Jump to content

switchcase/declaration problem


Recommended Posts

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

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

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 by uppersoul
Link to comment
Share on other sites

If BitAND($SSvalue, 1) = 0 Then ...

Perhaps?

WBD

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...