Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/27/2021 in Posts

  1. mLipok

    If "that" in "this"

    Try to do it in this way: _Example() Func _Example() Local $sSearchFor = InputBox("Please enter a word you want to search for", "") If StringInStr(FileRead('PATH TO YOUR FILE', $sSearchFor)) Then ; Do yours stuff EndIf EndFunc ;==>_Example
    2 points
  2. jchd

    Floating numbers issue

    A more low-level illustration of what's under the hood: $n = 0.01 is represented internally by the exact value +0.0099840000000000002078337502098293043673038482666015625 After performing this loop: Local $n = 2 For $i = 1 To 23 $n += 0.01 Next $n has the exact internal representation +2.2299999999999950972551232553087174892425537109375 while the value 2.23 is exactly represented internally as +2.229999999999999982236431605997495353221893310546875 which shows that equality can't be achieved. Each value shown above results from exactly computing and composing the components (sign, scale, mantissa) of the low-level FP representation.
    1 point
  3. Maybe try passing the "dir" command line parameter like in the original screenshot?
    1 point
  4. Ok argumentum, I'll let you know when this working patch is ready and fully tested. It will take some time as I got, starting tomorrow, some tax return to prepare. Bravo for your script in your last comment, which pulled the data and created the arrays, nicely done
    1 point
  5. yes, I pulled the data: from the web page and Arrayfy it the way Yashied did. Then added those entries Yashied have and the page don't have. Had to give'em a name so I used those from the webpage, tho, yes, renaming would make shorter code possible. You are much more proficient with all this GUI stuff than me. The modifications are simple to find and change. You know what you have in mind and are familiar with the challenges. I say you give me the code to include/patch and I'll post it. It'll be easier than back and forth ideas, and I trust your coding ideas. So its been decided, all in favor say yey ( yey ), motion passes for you to supply a working patch lol, me too
    1 point
  6. Nine

    Floating numbers issue

    And using case-sensitive strings operator is not going to help either
    1 point
  7. The benefit of maintaining the data in an external file (here the .txt) is, that you can make additions without having to constantly change the script itself. Here is an example which contains both variants (comment out the unwanted one) : #include <Array.au3> #include <File.au3> ; ====> Comment out variant 1 or 2 depending on your needs ; ----> Variant 1 : Read data from a file : -------------- ;~ Global $aHWIDList, $sFilePath, $bHWIDFound, $sHWIDInput ;~ $sFilePath = @ScriptDir & "\HWIDList.txt" ;~ $bHWIDFound = False ;~ _FileReadToArray($sFilePath, $aHWIDList, $FRTA_NOCOUNT, ";") ; ----- End of Variant 1 --------------------------------- ; ----> Variant 2 : array within the script : ------------ Global $bHWIDFound, $sHWIDInput Global $aHWIDList[4][2] = [["42421425", "mark"], _ ["85738578", "monte"], _ ["84885282", "heinz"], _ ["98573857", "tobiData"]] $bHWIDFound = False ; ----- End of Variant 2 --------------------------------- _ArrayDisplay($aHWIDList, "Test : Output") ; *** just for display during test For $i = 0 To UBound($aHWIDList) - 1 If _GetHWID() = $aHWIDList[$i][0] Then MsgBox(0, "HWID found", "HWID=" & $aHWIDList[$i][0] & " Name=" & $aHWIDList[$i][1] & @CRLF) $bHWIDFound = True ExitLoop EndIf Next If Not $bHWIDFound Then $sHWIDInput = InputBox("HWID_ERROR", "Contact Support!", _GetHWID(), "", 270, 150) If @error Then Exit Else ClipPut(_GetHWID()) Exit EndIf EndIf ; naked function for testing : Func _GetHWID() Local $sHWID = "" ; ... put the real GetHWID statements here $sHWID = "84885282" ; only for test Return $sHWID EndFunc
    1 point
×
×
  • Create New...