10 posts in this topic
Good morning community!
I am working on a script which read from a text file ( .txt ) and should import all the content in a SQLite3 DB, in order to execute some queries that should be difficult to execute on a text file.
So, I was looking for something very very fast, because the file could be very large ( I don't know exaclty how much can became big, but I know a lot of rows, it's a log file ... )
I found the "Import method", but I don't know If I can implement it in a query ( @jchd, it's your turn! )
Do you know some methods that I can implement in my script to have a very very fast import of thousands and thousands rows in a SQLite3 DB?
Thanks a lot
I was wondering is this all inputs can be done in 1 box with 3 fields and not to use another gui.
And how can i validate data for example if i don't enter username he prompt me a message box all time until field is empty.
I try like this but it give me a msgbox and continue on another field.
$username = InputBox("Add new user", "Username", "", "", 200, 130, Default, Default, 0) if $username <> " " then msgbox(0, "", "Please enter username") endif $email = InputBox("Add new user", "Email", "", "", 200, 130, Default, Default, 0) $password = InputBox("Add new user", "Password", "", "*", 200, 130, Default, Default, 0)
I have a compiled script :-timeStampSecs.exe which returns timestamp in seconds. I call it in FileWrite to write the time stamp in a text file.But it writes some other values instead of the timestamp. Please help.
The script is below:-
$kNum=run("timeStampSecs.exe","",1); also tried with flags 2,4,8,10 $hFile=FileOpen("timeStamp.txt",2) FileWrite($hFile,"the key is: "&$kNum) FileClose("$hFile") ;Code of thetimeStampSecs.exe:- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #include <Date.au3> Func secFromEpoch() Local $ts=_DateDiff( "s","1970/01/01 00:00:00",_NowCalc()) $ts=String($ts) ConsoleWrite("timeStamp is: "&$ts&@CRLF) Return $ts EndFunc secFromEpoch()
I'm having trouble in making an input box where I can limit the characters that can be inputted. Anybody have an idea how this can be done in Auto IT?
Specifically I would like to create an input field where the user would enter a MAC address. What I would like to do is to limit the characters that can be inputted to only HEX values (A-F and 0-9 as well as the - character). This is so that the user cannot input invalid characters. The program is going to be used by very non-technical people, so the idea is to remove as many chances for errors that we can think of. I would also prefer to limit the field to only 17 characters, so that there is only enough space to enter the MAC address with the - character as the separator.
Thank you all in advance for any suggestions!
I'm trying to create an inputbox that automatically formats numbers with leading zeroes when the updown control is used. I found an example from Melba23 (see below) that shows a step incremented inputbox, and based on that, I tried to create one that would work, but it does not.
I am creating separate inputs for hours and minutes, and I want to make sure the inputbox is always 2 digits. And right up front, I don't pretend to really understand the DLLStruct* calls..
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <UpDownConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("5000", 10, 10, 100, 20) $hUpDown = GUICtrlCreateUpdown($hInput, BitOR($UDS_WRAP, $UDS_NOTHOUSANDS)) GUICtrlSetLimit($hUpDown, 6000, 5000) GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) ; Is it from the UpDown? If BitAND($wParam, 0xFFFF) = $hUpDown Then ; Create NMUPDOWN structure Local $tStruct = DllStructCreate("hwnd;long;int;long;long", $lParam) ; Is it a change message? If DllStructGetData($tStruct, 3) = 0xFFFFFD2E Then ; $UDN_DELTAPOS ; Alter the change value DllStructSetData($tStruct, 5, 100 * DllStructGetData($tStruct, 5)) EndIf EndIf EndFunc ;~ The NMUPDOWN structure holds: ;~ 1 - Handle of UpDown ;~ 2 - ControlID of UpDown ;~ 3 - Message type sent by UpDown ;~ 4 - Current value of UpDown ;~ 5 - Change to apply to input (+/-1) And here is my non-working sample (it runs, and the initial value shows correctly, but when you hit the updown, you lose the leading zeroes.
#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> $hGUI = GUICreate("Window", 300, 100, -1, -1) $Count = 1 Global $hEdit = GUICtrlCreateInput($Count, 15, 15, 100, 30) GUICtrlSetFont(-1, 12, 400, "", "Tahoma") GUICtrlSetData(-1, StringFormat("%03u",$Count)) Global $hUpDown = GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1, 100, 0) GUISetState() While 1 $hMsg = GUIGetMsg() Switch $hMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) ; Is it from the UpDown? If BitAND($wParam, 0xFFFF) = $hUpDown Then ; Create NMUPDOWN structure Local $tStruct = DllStructCreate("hwnd;long;int;long;long", $lParam) ; Is it a change message? If DllStructGetData($tStruct, 3) = 0xFFFFFD2E Then ; $UDN_DELTAPOS ; Alter the change value $ValueToSet = DllStructGetData($tStruct, 4) $ValueToSet = StringFormat("%03u", $ValueToSet) GUICtrlSetData($hEdit, $ValueToSet) EndIf EndIf EndFunc