Search the Community
Showing results for tags 'values'.
-
#Include <Array.au3> #include <Constants.au3> $s = FileRead("2.txt") Local $w = StringRegExp($s, '(?is)(\b\w+\b)(?!.*\b\1\b)', 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 StringRegExpReplace($s, '(?i)\b' & $w[$i][0] & '\b', $w[$i][0]) $w[$i][1] = @extended Next _ArraySort($w, 1, 0, 0, 1) _ArrayDisplay($w) i have this script that returns 3 columns i need to copy the Col 0 and Col 1 as text to paste on notepad or excel you will have to create a "copy" button if possible array.au3 2.txt
-
I am trying to build a list from a query run against a sybase db. This part works fine. My problem is this, I want to display values in a list depending on the value of certain fields i.e. See below which works for two. Unfortunately, I need it to work for 3 values. I don't know how I can do this for 3. I did try doing a select case but I was getting errors. i.e. if value =0 then "Card Check" if Value = - Then "Card Spend" Else "Money Added" The below immediate iif works brilliantly for two but as I say I need to build this with 3 different values. $idItem = GUICtrlCreateListViewItem( _iif($adoRs.Fields("TransactionAmount").value =0, "Card check","Money Added") Any help appreciated.
-
I'm trying to take array values which I can't seem to get all the values into the array to send to the GUI window and I can't seem to get the array to even go into the GUI window. Here is the FULL code I'm working with. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Green.ico #AutoIt3Wrapper_Outfile=DriverInstall.exe #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** AutoItWinSetTitle("Driver Install") AutoItSetOption("MustDeclareVars", 1) Opt("TrayMenuMode", 0) #NoTrayIcon #include-once #RequireAdmin #include <GUIconstants.au3> #include <myerror.au3> #include <misc.au3> #include <Array.au3> If _Singleton("Driver Install", 1) = 0 Then Exit EndIf Local $Result Local $NumComports = -1, $OrigPortNum[30] Local $NewPortNum[30], $NewNumComports = -1 Local $GUIhandle, $CM[10], $AddedPort, $msg, $newports[20], $oldports[20] ; Update registry to ignor dongle serial number $Result = RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags", "IgnoreHWSerNum04036001", "REG_BINARY", Chr(1)) If $Result = 0 Then $ErrorTitle = "Error Updating Registry" $ErrorMessage = "Unable to update registry UsbFlags" $IsErrorFatal = True MyError() EndIf MsgBox(0, "Alert!", "Please make sure OBD processor is not plugged into the computer.") BuildOriginal() Run("CDM20828.EXE") MsgBox(0, "Alert!", "Now plug in the OBD processor into the USB port on the computer. When you have plugged it in click OK.") BuildNew() GUIwindow() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Quit() EndSelect WEnd Exit Func Quit() Exit EndFunc Func BuildOriginal() Local $Instance = 1, $Key = "", $Port = "", $Found = False While 1 $Key = RegEnumVal("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM", $Instance) If @error = -1 Then ExitLoop EndIf $Port = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM",$Key ) $NumComports += 1 $OrigPortNum[$NumComports] = $Port $Instance += 1 WEnd for $Instance = 0 To $NumComports _ArrayPush($OrigPortNum,$OrigPortNum[$Instance], 0) Next EndFunc Func BuildNew() Local $Instance = 1, $Key = "", $Port = "", $Found = False, $i = 0 While 1 $Key = RegEnumVal("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM", $Instance) If @error = -1 Then ExitLoop EndIf $Port = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM",$Key ) $NewNumComports += 1 $NewPortNum[$NewNumComports] = $Port $Instance += 1 WEnd for $Instance = 0 To $NewNumComports _ArrayPush($NewPortNum,$NewPortNum[$Instance], 0) Next For $i = 0 To $NewNumComports If ($NewPortNum[$i] <> $OrigPortNum[$i]) Then ;MsgBox(0, "Alert!", "Found new Port!" & $NewPortNum[$i]) $Addedport = $NewPortNum[$i] ExitLoop EndIf Next EndFunc Func GUIwindow() $GUIhandle = GUICreate("Port Settings", 455, 325) GUICtrlCreateLabel("-Before OBD doggle plugin-", 15, 25) $CM[1] = GUICtrlCreateEdit("", 15, 45, 180, 100, 400) GUICtrlSetData($CM[1], $OrigPortNum, $OrigPortNum) GUICtrlCreateLabel("-After OBD doggle plugin-", 250, 25) $CM[2] = GUICtrlCreateEdit("", 250, 45, 180, 100, 400) GUICtrlSetData($CM[2], $NewPortNum, $NewPortNum) GUICtrlCreateLabel("This is the added port:", 15, 300) $CM[3] = GUICtrlCreateEdit("", 120, 300, 150, 20) GUICtrlSetData($CM[3], $AddedPort, $AddedPort) GUISetState(@SW_SHOW) ;shows the GUI window EndFunc