liten Posted August 14, 2009 Share Posted August 14, 2009 SImple question how do i set a value to have a range instead of 1 number such as $Value = 1 thru 10 instead of $value1 = 1 $value2 = 2 etc.. My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u] Link to comment Share on other sites More sharing options...
billthecreator Posted August 14, 2009 Share Posted August 14, 2009 Local $Value[11] For $r = 1 To 10 $Value[$r] = $r Next is this what you're looking for [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
Exit Posted August 14, 2009 Share Posted August 14, 2009 For $i = 1 To 10 Assign ("Value"&$i,$i) Next MsgBox(0, '', Eval("value5")) App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
liten Posted August 14, 2009 Author Share Posted August 14, 2009 not really more of something that can be used in this way $numberrange = 1 to 50 if $currentnumber = $numberrange then Func() else this says if $currentnumber is equal 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 but wiht out havign to type that out My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u] Link to comment Share on other sites More sharing options...
Valuater Posted August 14, 2009 Share Posted August 14, 2009 Maybe.... $num_max = 50 $num_min = 1 If $currentnumber >= $num_min And $currentnumber <= $num_max Then 8) Link to comment Share on other sites More sharing options...
liten Posted August 14, 2009 Author Share Posted August 14, 2009 OMG your a Guinnessn My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u] Link to comment Share on other sites More sharing options...
BlackLumiere Posted September 29, 2020 Share Posted September 29, 2020 Hi all. It's been almost 11 years since this post. Even so, I would like to give a workaround function. This function is UDF and is inspired in the seq() function in R language. As it returns an 1D array, it also can be indexed easily. I hope can be useful to you all. Cheers! #include-once #include <Array.au3> Func seq($from, $to, $by = 1) Local $vector[0] Local $strVector for $e = $from to $to Step $by $strVector = $strVector & $e & ' ' Next $strVector = StringTrimRight($strVector, 1) _ArrayAdd($vector, $strVector, 0, ' ') ;~ _ArrayDisplay($vector) <== [Debug] ConsoleWrite('[1] ' & $strVector & @CRLF) Return $vector EndFunc ;Test $test1 = seq(1, 10) $test2 = seq(1, 10, 3) $indexTest3 = seq(1, 10, 1) ConsoleWrite('[1] ' & $indexTest3[0] & @CRLF) ConsoleWrite('[1] ' & $indexTest3[1] & @CRLF) Link to comment Share on other sites More sharing options...
JockoDundee Posted September 30, 2020 Share Posted September 30, 2020 On 8/14/2009 at 4:13 PM, liten said: this says if $currentnumber is equal 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 but wiht out havign to type that out you’re lucky $currentnumber is not a float Code hard, but don’t hard code... 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