Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/10/2022 in all areas

  1. This works just fine for me: #include <Excel.au3> Global $oExcel = _Excel_Open() Global $oNewWorkbook = _Excel_BookNew($oExcel) _Excel_RangeWrite($oNewWorkbook, Default, "2000", "D3") _Excel_RangeWrite($oNewWorkbook, Default, "=(B3-D3)", "E3") _Excel_RangeWrite($oNewWorkbook, Default, "100", "F3") _Excel_RangeWrite($oNewWorkbook, Default, "=(C3-F3)", "G3") $oRangeRow = $oNewWorkbook.ActiveSheet.Range("D3:G3") $oRangeRow.AutoFill($oNewWorkbook.ActiveSheet.Range("D3:G77"), 0) Seems $bValue is not needed. Excel detects formulas and processes them as needed.
    1 point
  2. Don't reinvent that wheel and use something like UltraVNC.
    1 point
  3. @mLipokSince the wiki targets less experienced users, it might be better to match their expectations. Maybe this? 8. How to run without a visible browser (headless mode)
    1 point
  4. I found out the problem and I must say I am a little bit ashamed 😚 The protocol to send the data to the serial could be visualized like this: <STX> <DATA> <ETX> <LRC> (with STX=02 and ETX=03) STX stands for Start of Text and ETX stands for End of Text. I presumed the LRC should only be calculated using the <DATA>, but upon rereading the protocol I saw that the <ETX> also needed to be included. Now, when I add the ETX to the array, the LRC indeed becomes: 0x06. I have added the 03 to the array (see below) and my LRC is now as expected. At least if some one needs a LRC implementation for Autoit, there is one working implementation in this forum. 😃 //Array Data is Hex values $LongStr = "30 30 43 31 30 30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 30 30 30 31 20 20 20 20 20 20 20 " $LongStr = $LongStr & "20 20 20 20 20 20 20 20 20 20 20 20 20 30 30 30 30 30 31 30 30 30 30 35 30 31 45 55 52 03" ; Expected LRC = 06 $aArray = StringSplit($LongStr, " ", $STR_CHRSPLIT ) $lrc = 0 $b = 0 For $t=1 to $aArray[0] $b = Dec($aArray[$t]) $lrc = BitXOR ($lrc,$b) Next MsgBox (0,"LRC","LRC (Dec) = " & $lrc & " Hex: " & Hex ($lrc) )
    1 point
  5. I suggest to use the Excel UDF to close Excel. #include <Excel.au3> HotKeySet("{ESC}", "_Terminate") ; Escape Global $oExcel While True Sleep(60000) If ProcessExists("excel.exe") Then $oExcel = _Excel_Open() ; Connect to the running Excel instance ; Close the Excel instance without saving open workbooks and force close the insance even when it is not created by _Excel_Open _Excel_Close($oExcel, False, True) EndIf WEnd Func _Terminate() If ProcessExists("excel.exe") Then $oExcel = _Excel_Open() ; Connect to the running Excel instance ; Close the Excel instance without saving open workbooks and force close the insance even when it is not created by _Excel_Open _Excel_Close($oExcel, False, True) EndIf Exit EndFunc
    1 point
  6. Look at "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" how it communicate with Scite using SendMessage+WM_COPYDATA, see these functions: SendSciTE_Command(), SendSciTE_GetInfo() EDIT: AutoIt3Wrapper is part of Scite4Autoit3 full editor
    1 point
  7. Malkey

    How to StringSplit only once

    Here is a third and fourth method of splitting a string on the first "#". #include <array.au3> Local $foo = 'abc#def#ghi#jkl#mno#pqr#stu#vwx#yz' Local $bar1_2 = StringRegExp($foo, '(.+?)#(.+)', 3) _ArrayDisplay($bar1_2) ;or Local $bar1 = StringRegExpReplace($foo, '(#.+)$', "") ; Erase from first "#", to end Local $bar2 = StringRegExpReplace($foo, '(^.+?#)', "") ; Erase from beginning, to first "#" MsgBox(0, "Results", "$foo = " & $foo & @LF & _ "$bar1 = " & $bar1 & @LF & _ "$bar2 = " & $bar2)
    1 point
  8. Melba23

    clearing Array

    hezi, Just redeclare the array and it is emptied for you: #include <Array.au3> Global $aArray[3] = [1, 2, 3] _ArrayDisplay($aArray) Global $aArray[3] _ArrayDisplay($aArray)If you want to get rid of the array completely, just declare it as a simple variable - $aArray = 0. M23
    1 point
×
×
  • Create New...