Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/20/2024 in all areas

  1. This is an UDF to create Mac style toolbars, like MobyDock, ObjectDock... screenshots: IconDock_1.jpg IconDock_2.jpg IconDock_3.jpg examples included. Download: IconDock.zip for german users: http://www.autoit.de/index.php?page=Thread&postID=215581#post215581 enjoy
    1 point
  2. Heres an updated link again:
    1 point
  3. It's a simple change to the Capabilities that is passed to _WD_CreateSession. See the example in the FAQ section on the wiki.
    1 point
  4. Bowmore

    IsNumerical

    I would like to share this little function with you. I have found it very useful for validating the input of various functions where the input must be a numerical value. I hope you find it useful Dim $aNumbers[21] $aNumbers[1] = 12345 $aNumbers[2] = "-12345" $aNumbers[3] = +12345.678 $aNumbers[4] = "12345.678" $aNumbers[5] = "One" $aNumbers[6] = "" $aNumbers[7] = "123.One" $aNumbers[8] = 0xFF1165AB $aNumbers[9] = "0x0000Ff" $aNumbers[10] = 0x0000 $aNumbers[11] = "0x0000GG" $aNumbers[12] = 4.395179e+003 $aNumbers[13] = "4.395179e+003" $aNumbers[14] = 4.395179e-003 $aNumbers[15] = "4.395179e-003" $aNumbers[16] = 4e-003 $aNumbers[17] = 4E+003 $aNumbers[18] = "4e-003" $aNumbers[19] = "4E+003" For $i = 1 To 20 Step 1 MsgBox(0,"IsNumeric", '$aNumbers['& $i & '] = ' & $aNumbers[$i] & @CRLF & @CRLF & 'IsNumber() = ' & IsNumber($aNumbers[$i]) & @CRLF & @CRLF & 'IsString() = ' & IsString($aNumbers[$i]) & @CRLF & @CRLF & 'Number() = ' & Number($aNumbers[$i]) & @CRLF & @CRLF & '_IsNumerical() = ' & _IsNumerical($aNumbers[$i]) & @crlf ) Next ; #FUNCTION# ============================================================== ; Name...........: _IsNumerical ; Description ...: Uses a regular expression to check if $vValue can be interpreted as a numeric value ; Syntax.........: _IsNumerical($vValue) ; Parameters ....: $vValue - Value to test if it is numerical ; Return values .: True - If $vValue contains a numeric value ; ...............: False- If $vValue contains a non-numeric value ; Author ........: Bowmore <bowmore at lineone dot net> ; Modified.......: ; Remarks .......: Accepts values in Decimal, Hex and Exponential format. If $vValue is a string then ; the whole string must be numeric value for the function to return True ; Related .......: IsNumber, Number ; Link ..........: ; Example .......: Yes ; =============================================================== Func _IsNumerical($vValue) If IsNumber($vValue) Then Return True If StringRegExp($vValue, "(^[+-]?[0-9]+\.?[0-9]*$|^0x[0-9A-Fa-f]{1,8}$|^[0-9]+\.?[0-9]*[Ee][+-][0-9]+$)") Then Return True Return False EndFunc Edit: Added IsNumber() check to speed things up a bit.
    1 point
×
×
  • Create New...