Leaderboard
Popular Content
Showing content with the highest reputation on 10/10/2016 in all areas
-
Terenz, Here is an example of LvVirtArraySort with checkboxes. The rows are sorted according to checked state and column. Picture to the left. I'm not quite sure if that's what you mean with point 1. If I've misunderstood it, you have to add a new post. In the next example the first row is left unsorted. It's always the first row. To keep code simple I've removed the tab control and some of the functionality of the buttons in the listview header. The sorting is only in the ascending order with respect to the columns. Now that I've found out how to do it, I'll add the functionality of the header buttons again. I might manage to make a new example till tomorrow. Virtual ListViews.7z2 points
-
If you are only trying to get JavaScript returns with AutoIt I would suggest ScriptControl. Example: $oSC = ObjCreate("ScriptControl") $oSC.Language = "JScript" $oSC.AddCode("var testvar={a:123,b:456,c:789}"); or could be FileRead like: $oSC.AddCode(FileRead("script.js")) $testvar = $oSC.Eval("testvar") MsgBox(0, "", "testvar.a: "&$testvar.a&@CRLF&"testvar.b: "&$testvar.b&@CRLF&"testvar.c: "&$testvar.c) MsgBox(0, "", "testvar.a+testvar.b+testvar.c = "&$oSC.Eval("testvar.a+testvar.b+testvar.c")) Additional information here: Using the ScriptControl Here's a finished solution:2 points
-
Yes of course, there are many real-world scenarii where a hammer isn't the right tool and others where legacy prevails. Yet, there are also ubiquitous cases where a formal development would be a winner. Think OS for instance. Granted, a modern OS is a monster but having built the first version on strong feet would have greatly helped making more complex successors correct (I mean robust = bug-free). I find it nonsensical to limit robust OSes to mission-critical systems, as the gross loss in countless trillions of work hours and disastrous consequences of zillion bugs in worldwide laymen OSes has been (or is, or will be) much more costly than having spent the time, money, energy and rigor to make it/them correct in the first place. But as you know that money governs instead of brains, you also know that it won't happen anytime soon.1 point
-
ScriptControl is missing normal stuff from browser js sutch as native JSON (you can add it with a script). I remember having issues with trying to implement a script for string compression, but a few line changes to scriptcontrol here and there and it worked (It was lz-string.js and i believe it was some bitwise functionality). A big pro with scriptcontrol is the functionallity with something like AutoIt. Using AutoItObject.Au3, you can call AutoIt functions from within Javascript functions. you are also able to add elements from AutoIt in Javascript, however things like AutoIt arrays are Unknown type in Javascript. But if you are looking for webpage manipulation or such, IE is best. I would advise to play around with it if you wish Personally i love importing javascript elements into AutoIt, though in some cases the speed of AutoIt is more important than the flexibility of Javascript Edit: Here is a pdf export of my onenote page with scriptcontrol (seems better than browsing 3-4 pages for the same info) ScriptControl.pdf1 point
-
I mean, in a state machine, your code is basically: do select if conditions for state_A are realised then perform relevant actions and switch to state_K if conditions for state_B are realised then perform relevant actions and switch to state_U if conditions for state_C are realised then perform relevant actions and switch to state_X ... if no condition is realised then red alert as there is a specification hole end until stop_run1 point
-
My program does'nt wok in another pc
abdulrahmanok reacted to genius257 for a topic
I guess, but why? I used page inspector to find the form element and the attribute "name" (that i needed for this example) had the value "loginform". In FireFox and Chrome right click on element and press inspect element. In IE i think it's F12 to bring up the inspector. And seems like Edge also with right click->inspect element1 point -
My program does'nt wok in another pc
abdulrahmanok reacted to JLogan3o13 for a topic
@AutoBert in the future if you have an issue with something posted, how about simply reporting it rather than having a fit in-thread? Then, a member of the Mod team can review to see if the executable is actually an issue (which it isn't in this case).1 point -
Run if part of list
JoshG reacted to JLogan3o13 for a topic
@JoshG you probably could have tested this out yourself faster than you wrote the question... #include <Array.au3> Local $aNum[6] = [1122, 1130, 5337, 5338, 5339, 5440] _ArraySearch($aNum, 5338) ConsoleWrite(((@error) ? "Not Present" : "Present") & @CRLF)1 point -
My program does'nt wok in another pc
abdulrahmanok reacted to genius257 for a topic
Why not take advantage of the _IE functionality? $oIE = _IECreate("https://mybanner.qu.edu.qa/PROD/twbkwbis.P_WWWLogin") $oForm = _IEFormGetObjByName($oIE, "loginform") $oElement = _IEFormElementGetObjByName($oForm, "sid") _IEFormElementSetValue( $oElement, "user" ) $oElement = _IEFormElementGetObjByName($oForm, "PIN") _IEFormElementSetValue( $oElement, "pass" ) _IEFormSubmit($oForm)1 point -
1 point
-
I was busy and for this reason as for now, I made such a poor documentation. Currently I want to present example with comments: Global $__g_bCertTestingExample = (Not @Compiled) And (@ScriptName = 'CertUtil.au3') If $__g_bCertTestingExample Then _CertUtil_Example() Func _CertUtil_Example() If $__g_bCertTestingExample Then _DebugSetup() ; Get list of "Polish Certyfication Centers" form "National Certyfication Center" Local $dData = InetRead('https://www.nccert.pl/zaswiadczenia.htm', $INET_FORCERELOAD) Local $iBytesRead = @extended ; Convert the ANSI compatible binary string back into a string. Local $sData = BinaryToString($dData) ; Find only QCA *.crt or *.cer files Local $aFiles = StringRegExp($sData, '(?is)href="files/(.{1,20}QCA.{0,20}.c[ert]{2})"', $STR_REGEXPARRAYGLOBALMATCH) Local $sFileToDownload = '' Local $sFileFullPath_LocalDest = '' For $iFile_idx = 0 To UBound($aFiles) - 1 $sFileToDownload = $aFiles[$iFile_idx] ; Download QCA *.crt or *.cer files _CertUtil_ExampleDownload($sFileToDownload) $sFileFullPath_LocalDest = @ScriptDir & '\' & StringReplace($sFileToDownload, '%20', ' ') ; Add downloaded QCA file to the " Windows Certification Storage" _CertUtil_addstore('-enterprise CA', $sFileFullPath_LocalDest) Next EndFunc ;==>_CertUtil_Example1 point
-
This should work $s = FileRead("1.txt") $n = "2" ; $r = StringRegExpReplace($s, '(?s).*Disk\h+' & $n & '\N+\h(\d+\h+[KG]B)\h+\D.*', "$1") ; value + GB $r = StringRegExpReplace($s, '(?s).*Disk\h+' & $n & '\N+\h(\d+)\h+[KG]B\h+\D.*', "$1") ; value only Msgbox(0,"", $r) But if the columns are TAB separated in the file there is probably a simpler way1 point
-
Hi all, I know this is a crazy idea. But i think it might be a help for somebody. The name of this program is GRM Helper. i.e. GUIRegisterMsg Helper. This program helps you to write the guiregistermsg function code automatically. You can choose a control from the combo box. Then all events of that control will be displayed in a list view. You can click on an event for it;s details. Then you can check the events which you want to include in your code. Then type some details like; 1) Your control's handle. 2) Line number for inserting GUIRegisterMsg code. 3) Line number for inserting main function. And press the "Isert To SciTE" button. Your code is ready in scite. Here is the program. Updated Version 1.1 GRM Helper V1.1.zip The code written by this program. GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox If Not IsHWnd($Sample) Then $hWndListBox = GUICtrlGetHandle($Sample) $hWndFrom = $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word Switch $hWndFrom Case $Sample, $hWndListBox Switch $iCode Case $LBN_ERRSPACE ; Insert your code here Case $LBN_SELCHANGE ; Insert your code here Case $LBN_DBLCLK ; Insert your code here Case $LBN_SELCANCEL ; Insert your code here EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND1 point
-
SQLite encryption with System.Data.SQLite.dll
argumentum reacted to jchd for a topic
I just downloaded this version then copied the DLL in the @scriptdir from the zip file. Then this exemple works as intended: #include <SQLite.au3> ; don't include sqlite.dll.au3 !!! Local $path = @ScriptDir & "\mydb.sql" _SQLite_Startup ("System.Data.SQLite.dll") ConsoleWrite(_SQLite_LibVersion() & @LF) Local $row ; using encryption _SQLite_Open($path) _SQLite_Exec(-1, "pragma key = 'Radu is happy!';create table if not exists test (id integer, val text);" & _ "insert into test values (1, 'abc');") _SQLite_QuerySingleRow(-1, "select * from test;", $row) ConsoleWrite($row[1] & @LF) _SQLite_Close(-1) ; not using encryption over the encrypted DB gives a failure _SQLite_Open($path) _SQLite_QuerySingleRow(-1, "select * from test;", $row) ConsoleWrite(_SQLite_ErrMsg(-1) & @LF) _SQLite_Close(-1) ; changing back to no encryption _SQLite_Open($path) _SQLite_Exec(-1, "pragma key = 'Radu is happy!'") _SQLite_Exec(-1, "pragma rekey = ''") _SQLite_QuerySingleRow(-1, "select * from test;", $row) ConsoleWrite($row[1] & @LF) _SQLite_Close(-1) _SQLite_Shutdown()1 point