
Appie78
Active Members-
Posts
47 -
Joined
-
Last visited
About Appie78
- Birthday 07/05/1978
Profile Information
-
Location
Rijnsburg, The Netherlands
Appie78's Achievements

Seeker (1/7)
0
Reputation
-
Hi xAlimorAx, Put this line under your GUICreate, it works for me! WinSetOnTop("DCS2 Anti-Idle","",1) Have fun Arnaud
-
Searching in database and diplaying result.
Appie78 replied to Appie78's topic in AutoIt General Help and Support
Hi Manadar, It's working like a charm, the only thing which I don't understand is, when I've done a search and got a 'hit' the search after that with a number that doesn't exists is giving the previous result!!! (long sentence I hope you understand) And is there a way to embed _Arraydisplay into a GUI? This is my code now. Func SQLite() _SQLite_Startup() If @error > 0 Then MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit -1 EndIf _SQLite_Open("C:\Program Files\JEOL\Scan Sample\Database.db") _SQLite_Exec(-1, "Create table if not exists JEOL (TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd);") If @error > 0 Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit -1 EndIf $APause = $APause / 2 $Reference = IniRead($ini, "Stub", "Input " & $Stub, "Not Found") $End = @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC If Not FileExists("C:\Program Files\JEOL\Scan Sample\Database.db") Then _SQLite_Exec(-1, "Create table JEOL (TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd);") EndIf _SQLite_Exec(-1, "Insert into JEOL(TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd) values ('" & $Start & "','" & $Reference & "','" & $StepCount & "','" & $APause & "','" & $End & "');") _SQLite_GetTable2d(-1, "Select * From JEOL", $aResult, $iRows, $iColumns) _ArrayDisplay($aResult, "File dump all tables, JEOL") _SQLite_Close() _SQLite_Shutdown() $APause = 0 EndFunc ;==>SQLite Func SearchSQLiteGUI() $GUISQL = GUICreate("Test", 300, 300) $SearchRef = GUICtrlCreateInput("Test", 10, 10) $Search = GUICtrlCreateButton("Search", 100, 100) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $Search SearchSQLite() Case $nMsg = $GUI_EVENT_CLOSE GUIDelete($GUISQL) ExitLoop EndSelect WEnd EndFunc ;==>SearchSQLiteGUI Func SearchSQLite() _SQLite_Startup() If @error > 0 Then MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit -1 EndIf _SQLite_Open("C:\Program Files\JEOL\Scan Sample\Database.db") _SQLite_Exec(-1, "Create table if not exists JEOL (TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd);") If @error > 0 Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit -1 EndIf _SQLite_GetTable2d(-1, "SELECT * FROM JEOL WHERE ReferenceNumber ='" & GUICtrlRead($SearchRef) & "'", $SearchResult, $iRows, $iColumns) _ArrayDisplay($SearchResult, "File dump all tables, JEOL") EndFunc ;==>SearchSQLite Thanks, Appie -
Hi all, I'm using a database to log some things which are importent to me. I want to make a function to search in the database on 'reference number' and/or 'date(TimeStart)'. As I am a noob on databases Can somebody push me in a good direction? Func SQLite() _SQLite_Startup() If @error > 0 Then MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit -1 EndIf _SQLite_Open("C:\Program Files\JEOL\Scan Sample\Database.db") _SQLite_Exec(-1, "Create table if not exists JEOL (TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd);") If @error > 0 Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit -1 EndIf $APause = $APause / 2 $Reference = IniRead($ini, "Stub", "Input " & $Stub, "Not Found") $End = @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC If Not FileExists("C:\Program Files\JEOL\Scan Sample\Database.db") Then _SQLite_Exec(-1, "Create table JEOL (TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd);") EndIf _SQLite_Exec(-1, "Insert into JEOL(TimeStart,ReferenceNumber,AmountFields,PauseNr,TimeEnd) values ('" & $Start & "','" & $Reference & "','" & $StepCount & "','" & $APause & "','" & $End & "');") _SQLite_GetTable2d(-1, "Select * From JEOL", $aResult, $iRows, $iColumns) _ArrayDisplay($aResult, "File dump all tables, JEOL") _SQLite_Close() _SQLite_Shutdown() $APause = 0 EndFunc ;==>SQLite This is my function to fill the database. Thanks in advance, Appie
-
Try this I tested it and it worked!! You probably forgot the "#include <GUIConstantsEx.au3>" #include <GUIConstantsEx.au3> GUICreate("Test", 100, 100) GUICtrlCreateLabel("Test Window", 10, 10) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
-
Hi DotJock, The "$Case" should be "Case". Try this! While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE EndSelect WEnd Appie
-
Hi all, It's like a miracle happened, it's working now!!!! The only thing that worries me is that I didn't change anything in my code. The only thing is that I put my laptop to hibernate twice! Well anyway thanks for the help. Appie
-
Hi DYONISII, Both functions are called from another function, so both get called but not after eachother. Thanks for the reply @Yashied, I'll try and sort some things out tonight. Thanks, Appie
-
Hi Yashied, $Begin = $Array[$i][$i] Also tested this with a Msgbox which returns me the correct data. The file is created when I run the script, but all the lines from the two functions don't get written into the file. Thanks, Appie
-
Hi Guys, I've got a little problem with the Filewrite(). Below code isn't working, it does create the file and the Filewrite return a "Succes" in the Msgbox. Func Begin() $FileLog = FileOpen("C:\Images\" & $Begin & "\" & $Begin & "(" & @MDAY & "-" & @MON & "-" & @YEAR & ")" & ".log", 9) If $FileLog = -1 Then MsgBox(0, "Error", "Unable to open logfile.") Return EndIf If Not $Stub = 1 Then FileWrite($FileLog, @CRLF) EndIf $line = FileWrite($FileLog, "Started: " & @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF) MsgBox(0, "", $line) EndFunc ;==>Begin Func Eind() FileWrite($FileLog, "Reference number:Stub" & @CRLF) FileWrite($FileLog, "Ammount of fields observed: " & $StepCount & @CRLF) FileWrite($FileLog, "Ammount of fibres counted: " & $Vezel & @CRLF) FileWrite($FileLog, "Ammount of pictures taken: " & $Number - 1 & @CRLF) FileWrite($FileLog, "Finished: " & @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF) FileClose($FileLog) EndFunc ;==>Eind Anyone who can help me out? Thanks
-
Function slow with COM activity in it?
Appie78 replied to Appie78's topic in AutoIt General Help and Support
Thanks Lars, But this was not the answer I was hoping for I will test it in VBS aswell just to be sure. If anyone got some more info please let me know. Greetz, Appie -
Hi all, My script gets quite slow when I do it like below: For $i = 1 To 25 $Mag = $MPSMag.GetMag() If $Mag <> 1000 Then $MPSMag.SetMag(0, 1000) EndIf $Tilt = $MPSStage.GetStagePos(2) If $Tilt > 20 Then $HighTilt = InputBox("Tilt angle to high", "Set tilt angle", "0", " M2") If IsNumber($HighTilt) Then $MPSStage.SetStagePosT(0, $HighTilt, 0) EndIf EndIf $HT = $MPSGun.GetAccv() If $HT < 20000 Then $LowHT = InputBox("ACCV to low", "Current Accelerating Voltage is " & $HT & @CRLF & "Set Accelerating Voltage", "20000", " M5") If $LowHT > 19999 Then $MPSGun.SetAccv($LowHT) EndIf EndIf Opt("mouseclickdowndelay", 1200) MouseClick("left", 325, 611, 1, 1) $Time = GUICtrlRead($Time1) * 1000 $Timer = TimerInit() While TimerDiff($Timer) < $Time Sleep(20) WEnd $StepCount += 1 GUICtrlSetData($lblData, $StepCount) Next When I take the COM part out of the For...Next loop the speed is normal. Is there any way to make it quicker with the COM part in? Thanks, Appie
-
Add this to your While loop. CODECase $Btn_exit Exit Cheers Appie
-
Nice program, nice small GUI and works great!! Greetz, Arnaud
-
Hi You've made the variable $Button4. Now you should call it. Case $Msg = $Button4 Do something Arnaud
-
Hi Vincent, It's under Tools! If it's not there download the link below. http://www.autoitscript.com/cgi-bin/getfil...iTE4AutoIt3.exe Cheers, Appie