#include #include #include #include #include #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Inputer", 246, 203, -1, 0) $Edit1 = GUICtrlCreateEdit("", 104, 16, 121, 161, BitOR($ES_MULTILINE,$ES_READONLY)) GUICtrlSetData($Edit1, "How to use" & @CRLF & "1. Push Btn for select a table" & @CRLF & "2. Ctrl+V for paste" & @CRLF & "3. Ctrl+B for renewal") $Button1 = GUICtrlCreateButton("A", 16, 16, 73, 25) $Button2 = GUICtrlCreateButton("B", 16, 48, 73, 25) $Button3 = GUICtrlCreateButton("C", 16, 80, 73, 25) $Button4 = GUICtrlCreateButton("D", 16, 112, 73, 25) $Button5 = GUICtrlCreateButton("E", 16, 144, 73, 25) $Label1 = GUICtrlCreateLabel("", 32, 176, 36, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $aRow, $t1, $irandom, $lbtext Func B1() GUICtrlSetData($Label1, "") GUICtrlSetData($Edit1, "") GUICtrlSetData($Label1, "A") _SQLite_QuerySingleRow(-1, "SELECT max(rowid) FROM a", $aRow) $irandom = Random(1, $aRow[0], 1) _SQLite_QuerySingleRow(-1, "SELECT * FROM a WHERE rowid = " & $irandom, $t1) GUICtrlSetData($Edit1, $t1[0]) ClipPut($t1[0] & @CRLF) EndFunc Func B2() GUICtrlSetData($Label1, "") GUICtrlSetData($Edit1, "") GUICtrlSetData($Label1, "B") _SQLite_QuerySingleRow(-1, "SELECT max(rowid) FROM b", $aRow) $irandom = Random(1, $aRow[0], 1) _SQLite_QuerySingleRow(-1, "SELECT * FROM b WHERE rowid = " & $irandom, $t1) GUICtrlSetData($Edit1, $t1[0]) ClipPut($t1[0] & @CRLF) EndFunc Func B3() GUICtrlSetData($Label1, "") GUICtrlSetData($Edit1, "") GUICtrlSetData($Label1, "C") _SQLite_QuerySingleRow(-1, "SELECT max(rowid) FROM c", $aRow) $irandom = Random(1, $aRow[0], 1) _SQLite_QuerySingleRow(-1, "SELECT * FROM c WHERE rowid = " & $irandom, $t1) GUICtrlSetData($Edit1, $t1[0]) ClipPut($t1[0] & @CRLF) EndFunc Func B4() GUICtrlSetData($Label1, "") GUICtrlSetData($Edit1, "") GUICtrlSetData($Label1, "D") _SQLite_QuerySingleRow(-1, "SELECT max(rowid) FROM d", $aRow) $irandom = Random(1, $aRow[0], 1) _SQLite_QuerySingleRow(-1, "SELECT * FROM d WHERE rowid = " & $irandom, $t1) GUICtrlSetData($Edit1, $t1[0]) ClipPut($t1[0] & @CRLF) EndFunc Func B5() GUICtrlSetData($Label1, "") GUICtrlSetData($Edit1, "") GUICtrlSetData($Label1, "E") _SQLite_QuerySingleRow(-1, "SELECT max(rowid) FROM e", $aRow) $irandom = Random(1, $aRow[0], 1) _SQLite_QuerySingleRow(-1, "SELECT * FROM e WHERE rowid = " & $irandom, $t1) GUICtrlSetData($Edit1, $t1[0]) ClipPut($t1[0] & @CRLF) EndFunc HotKeySet("^b", "Kt") Func Kt() $lbtext = GUICtrlRead($Label1) If $lbtext == "A" Then B1() ElseIf $lbtext == "B" Then B2() ElseIf $lbtext == "C" Then B3() ElseIf $lbtext == "D" Then B4() ElseIf $lbtext == "E" Then B5() EndIf EndFunc While 1 $nMsg = GUIGetMsg() _SQLite_Startup() If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!") EndIf Local $hDskDB = _SQLite_Open('sample.db') Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 B1() Case $Button2 B2() Case $Button3 B3() Case $Button4 B4() Case $Button5 B5() EndSwitch WEnd