Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/11/2018 in all areas

  1. Something like this makes more sense to me when you need 30 values: $N = 600 $Nm = 11 For $i = 0 To 30*$Nm Step $Nm FileWrite($FL,$N+$i&@CRLF) Next Jos
    1 point
  2. Global $hTimer = TimerInit (), $iTime While True Do something here or Sleep (50) $iTime = TimerDiff ($hTimer) if $iTime >= 5000 then ; when it reach 5 secs, execute something Do someother things here $hTimer = TimerInit () ; reinit timer endif Wend Self-explanatory.
    1 point
  3. @malka Take a look at WMI on the Internet
    1 point
  4. iamtheky

    1D to 2D Array Issues

    why regex if the string is built with two *reliable* delimiters? #include <Array.au3> $str = "route: 0100" & @CRLF & _ "S1: 1" & @CRLF & _ @CRLF & _ @CRLF & _ "J13P1 out (HF_AMP): 1" local $aArr[0][2] _ArrayAdd($aArr , StringStripWS($str , 4) , 0 , ":" , @CR) _ArrayDisplay($aArr)
    1 point
  5. mikell

    1D to 2D Array Issues

    Yes. Please read all about "arrays" in the help file But I am not fond of _ArrayAdd's in a loop. using regex I would rather have done it like this #include <Array.au3> $str = "route: 0100" & @CRLF & _ "S1: 1" & @CRLF & _ @CRLF & _ @CRLF & _ "J13P1 out (HF_AMP): 1" ; Msgbox(0,"", $str) $res = StringRegExp($str, '(?m)(^.+):(.+$)', 3) ;_ArrayDisplay($res) Local $res2D[UBound($res)/2][2] For $i = 0 To UBound($res) - 1 $res2D[$i/2][Mod($i, 2)] = $res[$i] Next _ArrayDisplay($res2D)
    1 point
  6. No one is as clued up on Arrays as @Subz and @FrancescoDiMuro... and I like their tag teaming..
    1 point
  7. FrancescoDiMuro meant it's just not good practice to declare Global variables within functions. It will work like in your example above, but its not seen as good practice.
    1 point
  8. You could do something like this : #include <ScreenCapture.au3> Opt ("MustDeclareVars", 1) Global $ahWnd = WinList ("Something here"), $aHBitMap[$ahWnd[0][0]] For $i = 1 to $ahWnd[0][0] WinActivate ($ahWnd[$i][1]) WinWaitActive ($ahWnd[$i][1]) $aHBitMap[$i-1] = _ScreenCapture_CaptureWnd ("",$ahWnd[$i][1],0,0,200,200,False) Next
    1 point
  9. i think its possible. just one question to explain are the windows all @SW_maximize and @SW_show?
    1 point
  10. It's simply that we, occidentals, are soooo used to think only within some kind of ASCII that we too often forget that the vast majority of humans don't use any form of latin scripts, letters, digits and punctuation. Unicode tries hard (and succeeeds) to include less known (to occidentals) scripts and hence makes the less "common" scripts a tangible reality.
    1 point
  11. I apologize for my too early generalization
    1 point
  12. Not exactly all the same. When/if (*UCP) is used, [0-9] does exactly what it means (ASCII 0 to ASCII 9) while both other forms include codepoins that have the Nd (Numeric Decimal) properties. And that is a number of characters: from old Unicode v5.1: Codepoint Glyph CharacterName U+00030 '0' DIGIT ZERO U+00660 '٠' ARABIC-INDIC DIGIT ZERO U+006F0 '۰' EXTENDED ARABIC-INDIC DIGIT ZERO U+007C0 '߀' NKO DIGIT ZERO U+00966 '०' DEVANAGARI DIGIT ZERO U+009E6 '০' BENGALI DIGIT ZERO U+00A66 '੦' GURMUKHI DIGIT ZERO U+00AE6 '૦' GUJARATI DIGIT ZERO U+00B66 '୦' ORIYA DIGIT ZERO U+00BE6 '௦' TAMIL DIGIT ZERO U+00C66 '౦' TELUGU DIGIT ZERO U+00CE6 '೦' KANNADA DIGIT ZERO U+00D66 '൦' MALAYALAM DIGIT ZERO U+00E50 '๐' THAI DIGIT ZERO U+00ED0 '໐' LAO DIGIT ZERO U+00F20 '༠' TIBETAN DIGIT ZERO U+01040 '၀' MYANMAR DIGIT ZERO U+01090 '႐' MYANMAR SHAN DIGIT ZERO U+017E0 '០' KHMER DIGIT ZERO U+01810 '᠐' MONGOLIAN DIGIT ZERO U+01946 '᥆' LIMBU DIGIT ZERO U+019D0 '᧐' NEW TAI LUE DIGIT ZERO U+01B50 '᭐' BALINESE DIGIT ZERO U+01BB0 '᮰' SUNDANESE DIGIT ZERO U+01C40 '᱀' LEPCHA DIGIT ZERO U+01C50 '᱐' OL CHIKI DIGIT ZERO U+024EA '⓪' CIRCLED DIGIT ZERO U+024FF '⓿' NEGATIVE CIRCLED DIGIT ZERO U+0A620 '꘠' VAI DIGIT ZERO U+0A8D0 '꣐' SAURASHTRA DIGIT ZERO U+0A900 '꤀' KAYAH LI DIGIT ZERO U+0AA50 '꩐' CHAM DIGIT ZERO U+0FF10 '0' FULLWIDTH DIGIT ZERO U+104A0 '𐒠' OSMANYA DIGIT ZERO U+1D7CE '𝟎' MATHEMATICAL BOLD DIGIT ZERO U+1D7D8 '𝟘' MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO U+1D7E2 '𝟢' MATHEMATICAL SANS-SERIF DIGIT ZERO U+1D7EC '𝟬' MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO U+1D7F6 '𝟶' MATHEMATICAL MONOSPACE DIGIT ZERO U+E0030 '󠀰' TAG DIGIT ZERO It's a pity that most glyphs don't show up correctly. That's the extra price you pay for being born in a non-latin script area.
    1 point
  13. iamtheky, Very smart non-regex way I made a regex-oriented answer because ... of the title of the topic. Nothing personal caramen, The help file provides explicit details and explanations about the syntax, and should constantly be used as reference and be read carefully to avoid confusion Examples : ^0* : zero or more digit at the beginning of the string This is false. "0" means only 0 . A digit is \d, or [0-9], or [[:digit:]] (all the same) Ditto for ^ , which matches "start of string" but is also used inside a character class to negate its content So to match any non-digit, you might use \D , or [^0-9] , or [[:^digit:]]
    1 point
  14. This one will remove leading zero(s) and trailing non digit(s) - if exist $new = StringRegExpReplace($string, '^0*|\D*$', "") Edit : comments You want your regex to have 2 different actions, so an alternation is needed ^0* : zero or more "0" at the beginning of the string | : alternation \D*$ : zero or more non-digit characters at the end of the string
    1 point
×
×
  • Create New...