Leaderboard
Popular Content
Showing content with the highest reputation on 06/30/2015 in all areas
-
I translated and added some parameters to this function from Delphi sources on the web. Function supports 1D and 2D arrays. All array's data are converted to String datatype. This function doesn't depend on installed Microsoft Excel!! _ArrayToXLS(Const ByRef $avArray, $sFileName[, $Transpose = False[, $iStartRow = 0[, $iEndRow = 0[, $iStartCol = 0[, $iEndCol = 0]]]]]) Here it is also with simple example: #include <File.au3> #include <WinAPI.au3> Dim $myArray[6] = ['A','B','C','D','E','F'] _ArrayToXLS($myArray, @ScriptDir & '\test1.xls') _ArrayToXLS($myArray, @ScriptDir & '\test1t.xls', True) ; transpose _ArrayToXLS($myArray, @ScriptDir & '\test1x.xls', False, 2, 4) ; C,D,E _ArrayToXLS($myArray, @ScriptDir & '\test1xt.xls', True, 2, 4) ; C,D,E transposed Dim $myArray[2][3] = [['A','B','C'], ['D','E','F']] _ArrayToXLS($myArray, @ScriptDir & '\test2.xls') _ArrayToXLS($myArray, @ScriptDir & '\test2t.xls', True) ; transpose _ArrayToXLS($myArray, @ScriptDir & '\test2x.xls', False, 1, 1) ; second row: D,E,F _ArrayToXLS($myArray, @ScriptDir & '\test2xt.xls', True, 1, 1) ; second row: D,E,F transposed _ArrayToXLS($myArray, @ScriptDir & '\test2y.xls', False, 0, 0, 1, 2) ; B,C + E,F _ArrayToXLS($myArray, @ScriptDir & '\test2yt.xls', True, 0, 0, 1, 2) ; B,C + E,F transposed $myArray = _FileListToArray(@ScriptDir, '*', 1) _ArrayToXLS($myArray, @ScriptDir & '\test3.xls') _ArrayToXLS($myArray, @ScriptDir & '\test3x.xls', False, 1) ; skip first row (contains number of files) ShellExecute(@ScriptDir & "\test3x.xls") ; #FUNCTION# ==================================================================================================================== ; Name...........: _ArrayToXLS ; Description ...: Places the elements of an 1D or 2D array into an Excel file (XLS). ; Syntax.........: _ArrayToXLS(Const ByRef $avArray, $sFileName[, $Transpose = False[, $iStartRow = 0[, $iEndRow = 0[, $iStartCol = 0[, $iEndCol = 0]]]]]) ; Parameters ....: $avArray - Array to save ; $sFileName - Full path to XLS file ; $Transpose - [optional] At 2D array changes rows and columns ; $iStartRow - [optional] Zero based index (row) of array to start saving at ; $iEndRow - [optional] Zero based index (row) of array to stop saving at, if zero then last row is taken ; $iStartCol - [optional] Zero based index (column) of array to start saving at ; $iEndCol - [optional] Zero based index (column) of array to stop saving at, if zero then last column is taken ; Return values .: Success - 1 ; Failure - 0, sets @error: ; |1 - $avArray is not an array ; |2 - $avArray is not 1D/2D array ; |3 - $iStartRow is greater than $iEndRow ; |4 - $iStartCol is greater than $iEndCol ; |5 - couldn't create XLS file ; Author ........: Zedna ; Modified.......: ; Remarks .......: Function supports 1D and 2D arrays. All array's data are converted to String datatype. ; This function doesn't depend on installed Microsoft Excel. ; Related .......: _ArrayToString, _ArrayToClip ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _ArrayToXLS(Const ByRef $avArray, $FileName, $Transpose = False, $iStartRow = 0, $iEndRow = 0, $iStartCol = 0, $iEndCol = 0) Local $nBytes If Not IsArray($avArray) Then SetError(1, 0, 0) $iDimension = UBound($avArray, 0) If $iDimension > 2 Then SetError(2, 0, 0) $iUBound1 = UBound($avArray, 1) - 1 If $iEndRow < 1 Or $iEndRow > $iUBound1 Then $iEndRow = $iUBound1 If $iStartRow < 0 Then $iStartRow = 0 If $iStartRow > $iEndRow Then Return SetError(3, 0, 0) If $iDimension = 2 Then $iUBound2 = UBound($avArray, 2) - 1 If $iEndCol < 1 Or $iEndCol > $iUBound2 Then $iEndCol = $iUBound2 If $iStartCol < 0 Then $iStartCol = 0 If $iStartCol > $iEndCol Then Return SetError(4, 0, 0) EndIf $hFile = _WinAPI_CreateFile($FileName, 1) If @error Then Return SetError(5, 0, 0) $str_bof = DllStructCreate('short;short;short;short;short;short') DllStructSetData($str_bof, 1, 0x809) DllStructSetData($str_bof, 2, 0x8) DllStructSetData($str_bof, 3, 0x0) DllStructSetData($str_bof, 4, 0x10) DllStructSetData($str_bof, 5, 0x0) DllStructSetData($str_bof, 6, 0x0) _WinAPI_WriteFile($hFile, DLLStructGetPtr($str_bof), DllStructGetSize($str_bof), $nBytes) Switch $iDimension Case 1 ; 1D array For $i = $iStartRow To $iEndRow ; 0 To $iUBound1 If $Transpose Then __XLSWriteCell($hFile, 0, $i - $iStartRow, $avArray[$i]) Else __XLSWriteCell($hFile, $i - $iStartRow, 0, $avArray[$i]) EndIf Next Case 2 ; 2D array For $i = $iStartRow To $iEndRow ; 0 To $iUBound1 For $j = $iStartCol To $iEndCol ; 0 To $iUBound2 If $Transpose Then __XLSWriteCell($hFile, $j - $iStartCol, $i - $iStartRow, $avArray[$i][$j]) Else __XLSWriteCell($hFile, $i - $iStartRow, $j - $iStartCol, $avArray[$i][$j]) EndIf Next Next EndSwitch $str_eof = DllStructCreate('short;short') DllStructSetData($str_eof, 1, 0x0A) DllStructSetData($str_eof, 2, 0x0) _WinAPI_WriteFile($hFile, DLLStructGetPtr($str_eof), DllStructGetSize($str_eof), $nBytes) _WinAPI_CloseHandle($hFile) Return 1 EndFunc ; ==> _ArrayToXLS ; internal helper function for _ArrayToXLS() Func __XLSWriteCell($hFile, $Row, $Col, $Value) Local $nBytes $Value = String($Value) $Len = StringLen($Value) $str_cell = DllStructCreate('short;short;short;short;short;short') DllStructSetData($str_cell, 1, 0x204) DllStructSetData($str_cell, 2, 8 + $Len) DllStructSetData($str_cell, 3, $Row) DllStructSetData($str_cell, 4, $Col) DllStructSetData($str_cell, 5, 0x0) DllStructSetData($str_cell, 6, $Len) _WinAPI_WriteFile($hFile, DLLStructGetPtr($str_cell), DllStructGetSize($str_cell), $nBytes) $tBuffer = DLLStructCreate("byte[" & $Len & "]") DLLStructSetData($tBuffer, 1, $Value) _WinAPI_WriteFile($hFile, DLLStructGetPtr($tBuffer), $Len, $nBytes) EndFunc ; ==> __XLSWriteCell EDIT: Here is original Delphi source http://programujte.com/forum/vlakno/5645-jak-na-exel/ procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow: Word; const AValue: string); var L: Word; const {$J+} CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0); {$J-} begin L := Length(AValue); CXlsLabel[1] := 8 + L; CXlsLabel[2] := ARow; CXlsLabel[3] := ACol; CXlsLabel[5] := L; XlsStream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel)); XlsStream.WriteBuffer(Pointer(AValue)^, L); end; function SaveAsExcelFile(AGrid: TStringGrid; AFileName: string): Boolean; const {$J+} CXlsBof: array[0..5] of Word = ($809, 8, 00, $10, 0, 0); {$J-} CXlsEof: array[0..1] of Word = ($0A, 00); var FStream: TFileStream; I, J: Integer; begin Result := False; FStream := TFileStream.Create(PChar(AFileName), fmCreate or fmOpenWrite); try CXlsBof[4] := 0; FStream.WriteBuffer(CXlsBof, SizeOf(CXlsBof)); for i := 0 to AGrid.ColCount - 1 do for j := 0 to AGrid.RowCount - 1 do XlsWriteCellLabel(FStream, I, J, AGrid.cells[i, j]); FStream.WriteBuffer(CXlsEof, SizeOf(CXlsEof)); Result := True; finally FStream.Free; end; end; and here is link to more general Delphi code where is handled also writing integer/decimal datatypes. http://kurapaty.blogspot.com/2008/01/creating-excel-xls-from-delphi.html EDIT2: Here is link to topic in Examples for generating XML XLS (XLSX) without Excel installed from Jerome EDIT3: Here is link to topic in Examples for reading Excel data using SQL (ADO) without Excel installed from ptrex EDIT4: Very nice description of Excel x ADO in Delphi Accessing and managing MS Excel sheets with Delphi http://delphi.about.com/od/database/l/aa090903a.htm EDIT5: There is only one issue with XLS files generated this way: Badly formated national characters in cells when opened by Open Office/Libre Office. Inside binary XLS file and also when opened by Microsoft Excel it's OK. So I think it' some bug (maybe some bad autodetection of code page?) of Open Office/Libre Office. EDIT6: There is problem in MS Excel with data in cells bigger than 255 chars. For data > 255 chars Excel loads XLS file without errors but these cells are empty. This 255 chars problem isn't in LibreOffice (version 3.4.1) only in Microsoft Excel. See post #14, #15 for details1 point
-
Cannot use _GUICtrlEdit_SetText for 3-4 inputs..
Cyborg5000 reacted to MikahS for a topic
A while loop is an event loop. Meaning that it is looking for events on the GUI. If you're trying to autofill these values before there has been an event on the GUI, then you need to fill them before going into the loop, like so: #include <GUIConstants.au3> #include <GUIEdit.au3> #Region ### START Koda GUI section ### Form=c:\users\slingaya\desktop\system.kxf Local $System = GUICreate("BIOS", 652, 222, 194, 129, BitOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZE)) Local $Sysname = GUICtrlCreateLabel("System Name", 16, 8, 100, 20, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $Sysbiosver = GUICtrlCreateLabel("System BIOS Version", 16, 104, 151, 20, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $biosreldt = GUICtrlCreateLabel("BIOS Release Date", 16, 72, 139, 20, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $model = GUICtrlCreateLabel("System Model", 16, 40, 102, 20, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $dellavlbi = GUICtrlCreateLabel("Available Dell Bios Version", 16, 136, 194, 20, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $Checkbox1 = GUICtrlCreateCheckbox("Download", 488, 136, 105, 33, $BS_CHECKBOX) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $Button1 = GUICtrlCreateButton("Download and FLASH", 488, 168, 145, 41, $BS_DEFPUSHBUTTON) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") Local $Progress1 = GUICtrlCreateProgress(272, 176, 172, 25, BitOR($PBS_SMOOTH, $WS_BORDER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) Local $Button2 = GUICtrlCreateButton("Check BIOS Status", 488, 8, 145, 33, $BS_DEFPUSHBUTTON) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Local $sysmodel = GUICtrlCreateInput("", 272, 40, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) Local $Biorlsdt = GUICtrlCreateInput("", 272, 72, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) Local $sysbiover = GUICtrlCreateInput("", 272, 104, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) Local $Avdlbiovr = GUICtrlCreateInput("", 272, 136, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) Local $sysnamd = GUICtrlCreateInput("", 272, 8, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $compname = @ComputerName Local $sysmod = RegRead("HKLM64\HARDWARE\DESCRIPTION\System\BIOS", "SystemProductName") Local $biorldt = RegRead("HKLM64\HARDWARE\DESCRIPTION\System\BIOS", "BIOSReleaseDate") _GUICtrlEdit_SetText($sysmodel, $sysmod) _GUICtrlEdit_SetText($sysnamd, $compname) _GUICtrlEdit_SetText($Biorlsdt, $biorldt) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Sysname Case $Sysbiosver Case $biosreldt Case $model Case $dellavlbi Case $Checkbox1 Case $Button1 Case $Button2 Case $sysmodel _GUICtrlEdit_SetText($sysmodel, $sysmod) Case $Biorlsdt Case $sysbiover Case $Avdlbiovr Case $sysnamd _GUICtrlEdit_SetText($sysnamd, $compname) EndSwitch WEnd1 point -
Have a look at this topic: link Otherwise, give it a try and post what you've come up with.1 point
-
_ReplaceStringInFile($Dummies,$sFind ,$sFind & @CRLF & $sReplace)1 point
-
works just fine. Are you sure it is there, and it does not have an extension? and to clean up the above, which again works fine. #include<file.au3> $Dummies = @ScriptDir & "\Dummies" $sFind = "109.99.99.99" $sReplace = "No Longer Use" If FileExists($Dummies) Then _ReplaceStringInFile($Dummies,$sFind ,$sReplace) Else MsgBox(0, "Error", "Make sure Dummies file exist before you proceed to compile this project.") EndIf1 point
-
GUICtrlCreateProgress Help!
JuanFelipe reacted to argumentum for a topic
I'd write it like so: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $date = @MDAY & "/" & @MON & "/" & @YEAR #Region ### START Koda GUI section ### Form=c:\users\juan.caballeron\desktop\ \programacion\autoit\capturas\koda_1.7.3.0\forms\grabar capturas.kxf $Form1_1 = GUICreate("WhiteSnake... Para Colaboración de los compañeros, Pan y Gaseosa Diariamente para Caballo.", 686, 518, -1, -1) $MenuItem1 = GUICtrlCreateMenu("&Capturas") $MenuItem2 = GUICtrlCreateMenu("&Vehiculos") GUISetIcon("C:\Users\juan.caballeron\Desktop\ \Programacion\Autoit\Capturas\koda_1.7.3.0\iconos\Avatar on ice-256.ico", -1) GUISetCursor(7) GUISetBkColor(0xA6CAF0) $hechos = GUICtrlCreateGroup("Hechos", 16, 32, 449, 209) GUICtrlSetColor(-1, 0x000000) $box_fechah = GUICtrlCreateInput("", 112, 80, 81, 21);==== Fecha de Hecho GUICtrlSetLimit(-1, 10) $box_hora = GUICtrlCreateInput("", 112, 120, 81, 21);==== Hora GUICtrlSetLimit(-1, 5) $box_fechaf = GUICtrlCreateInput("", 112, 160, 81, 21);==== Fecha Fuente GUICtrlSetLimit(-1, 10) $box_fte = GUICtrlCreateInput("", 112, 200, 81, 21);==== Numero de fuente GUICtrlSetLimit(-1, 6) $Label3 = GUICtrlCreateLabel("Fecha Hecho:", 24, 80, 72, 17) $Label4 = GUICtrlCreateLabel("Hora:", 24, 120, 30, 17) $Label5 = GUICtrlCreateLabel("Fecha Fuente:", 24, 160, 73, 17) $Label6 = GUICtrlCreateLabel("Nro. Fuente:", 24, 200, 63, 17) $lbldirec = GUICtrlCreateLabel("Dirección de Caso", 264, 48, 91, 17) $lbl1 = GUICtrlCreateLabel("1.", 216, 88, 13, 17) $lbl2 = GUICtrlCreateLabel("2.", 216, 120, 13, 17) $boxcl = GUICtrlCreateCombo("", 240, 88, 41, 21);==== CALLE GUICtrlSetData($boxcl, "CL|KR|DG|TR") $numcl = GUICtrlCreateInput("", 288, 88, 41, 21);==== Número de Calle GUICtrlSetLimit(-1, 3) $comcl = GUICtrlCreateInput("", 336, 88, 41, 21);==== Composicion Calle GUICtrlSetLimit(-1, 4) $boxkr = GUICtrlCreateCombo("", 240, 120, 41, 21);==== Carrera GUICtrlSetData($boxkr, "CL|KR|DG|TR") $numkr = GUICtrlCreateInput("", 288, 120, 41, 21);==== Numero de Carrera GUICtrlSetLimit(-1, 3) $comkr = GUICtrlCreateInput("", 336, 120, 41, 21);=== Composicion Carrera GUICtrlSetLimit(-1, 4) $num2kr = GUICtrlCreateInput("", 384, 120, 41, 21);=== Complemento Carrera $pcardinal = GUICtrlCreateCombo("", 232, 160, 201, 21);==== Punto Cardinal GUICtrlSetData($pcardinal, "Sur|Norte|Oriente|Occidente") $noticia = GUICtrlCreateInput("", 232, 200, 201, 21);=== Noticia Criminal GUICtrlSetLimit(-1, 21) $Label13 = GUICtrlCreateLabel("P. Cardinal", 304, 144, 55, 17) $Label18 = GUICtrlCreateLabel("Tipo", 248, 72, 25, 17) $Label19 = GUICtrlCreateLabel("Num.", 296, 72, 29, 17) $Label20 = GUICtrlCreateLabel("Com.", 344, 72, 28, 17) $Label21 = GUICtrlCreateLabel("_______", 384, 88, 46, 17) $Label22 = GUICtrlCreateLabel("No. Noticia", 304, 184, 57, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $personas = GUICtrlCreateGroup("Datos de la Persona", 16, 256, 665, 185) $Label1 = GUICtrlCreateLabel("Tipo Identificación:", 32, 288, 94, 17) $Label2 = GUICtrlCreateLabel("No. Documento:", 32, 312, 82, 17) $Label7 = GUICtrlCreateLabel("Apellidos", 32, 336, 46, 17) $Label8 = GUICtrlCreateLabel("Nombres", 32, 360, 46, 17) $Label9 = GUICtrlCreateLabel("Sexo", 32, 384, 28, 17) $Label10 = GUICtrlCreateLabel("Fecha Nacimiento", 32, 408, 90, 17) $Combo1 = GUICtrlCreateCombo("", 128, 288, 49, 21);=== Tipo de Identificación GUICtrlSetData($Combo1, "TI|CC|CE|PS|RC") $documento = GUICtrlCreateInput("", 128, 312, 193, 21);=== Número de Identificación $apellidos = GUICtrlCreateInput("", 128, 336, 377, 21);=== Apellidos $nombres = GUICtrlCreateInput("", 128, 360, 377, 21);=== Nombres $Combo2 = GUICtrlCreateCombo("", 128, 384, 49, 21);====SEXO GUICtrlSetData($Combo2, "Mas|Fem") $fecha_naci = GUICtrlCreateInput("", 128, 408, 81, 21);=== Fecha Nacimiento GUICtrlSetLimit(-1, 10) $Label16 = GUICtrlCreateLabel("Use T. para Tarjeta y C. para Cédula.", 184, 288, 180, 17) $Label17 = GUICtrlCreateLabel("M. Masculino y F. Femenino", 184, 384, 136, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $datoscap = GUICtrlCreateGroup("Datos Capturas", 480, 32, 201, 209) $Label11 = GUICtrlCreateLabel("Tipo", 496, 80, 25, 17) $Label12 = GUICtrlCreateLabel("Fecha OJ", 496, 120, 50, 17) $Label14 = GUICtrlCreateLabel("Número OJ", 496, 160, 57, 17) $Label15 = GUICtrlCreateLabel("Delito", 496, 184, 31, 17) $tipocap = GUICtrlCreateCombo("", 560, 80, 97, 21);=== Tipo de Captura GUICtrlSetData($tipocap, "Flagrancia|Orden Judicial") $fechaoj = GUICtrlCreateInput("", 560, 120, 97, 21);=== Fecha de la Orden GUICtrlSetLimit(-1, 10) $numoj = GUICtrlCreateInput("", 560, 160, 97, 21);=== Número de la orden $delitocap = GUICtrlCreateInput("", 496, 200, 169, 21);=== Delito GUICtrlCreateGroup("", -99, -99, 1, 1) $Titulo = GUICtrlCreateLabel("PROCESO PARA GRABAR CAPTURAS EN EL SIEDCO.", 175, 8, 277, 17, $SS_CENTER) GUICtrlSetCursor(-1, 3) $Progress1 = GUICtrlCreateProgress(512, 472, 169, 9, BitOR($WS_BORDER, $WS_CLIPSIBLINGS)) GUICtrlSetCursor(-1, 15) $creador = GUICtrlCreateLabel("By WhiteSnake", 16, 472, 78, 17) GUICtrlSetColor(-1, 0xFF0000) $iniciar = GUICtrlCreateButton("INICIAR PROCESO", 360, 464, 145, 25) GUICtrlSetCursor(-1, 0) $Icon1 = GUICtrlCreateIcon("C:\Users\juan.caballeron\Desktop\ \Programacion\Autoit\Capturas\koda_1.7.3.0\iconos\1249549841170809086.ico", -1, 96, 464, 32, 32) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $sComboRead1 = "" Local $sComboRead2 = "" Local $sComboRead3 = "" Local $sComboRead4 = "" Local $sComboRead5 = "" Local $sComboRead6 = "" Local $sComboRead7 = "" Local $sComboRead8 = "" Local $sComboRead9 = "" Local $sComboRead10 = "" Local $sComboRead11 = "" Local $sComboRead12 = "" Local $sComboRead13 = "" Local $sComboRead14 = "" Local $sComboRead15 = "" Local $sComboRead16 = "" Local $sComboRead17 = "" Local $sComboRead18 = "" Local $sComboRead19 = "" Local $sComboRead20 = "" Local $sComboRead21 = "" Local $sComboRead22 = "" Local $sComboRead23 = "" Local $sError = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $iniciar $sComboRead1 = GUICtrlRead($box_fechah);========================== Fecha de Hecho $sComboRead2 = GUICtrlRead($box_hora);============================ Hora $sComboRead3 = GUICtrlRead($box_fechaf);========================== Fecha Fuente $sComboRead4 = GUICtrlRead($box_fte);============================= Numero de fuente $sComboRead5 = GUICtrlRead($boxcl);=============================== Calle $sComboRead6 = GUICtrlRead($numcl);=============================== Número de Calle $sComboRead7 = GUICtrlRead($comcl);=============================== Composicion Calle $sComboRead8 = GUICtrlRead($boxkr);=============================== Carrera $sComboRead9 = GUICtrlRead($numkr);=============================== Numero de Carrera $sComboRead10 = GUICtrlRead($comkr);============================== Composicion Carrera $sComboRead11 = GUICtrlRead($num2kr);============================= Complemento Carrera $sComboRead12 = GUICtrlRead($pcardinal);========================== Punto Cardinal $sComboRead13 = GUICtrlRead($noticia);============================ Noticia Criminal $sComboRead14 = GUICtrlRead($Combo1);============================= Tipo de Identificación $sComboRead15 = GUICtrlRead($documento);========================== Número de Identificación $sComboRead16 = GUICtrlRead($apellidos);========================== Apellidos $sComboRead17 = GUICtrlRead($nombres);============================ Nombres $sComboRead18 = GUICtrlRead($Combo2);============================= Sexo $sComboRead19 = GUICtrlRead($fecha_naci);========================= Fecha Nacimiento $sComboRead20 = GUICtrlRead($tipocap);============================ Tipo de Captura $sComboRead21 = GUICtrlRead($fechaoj);============================ Fecha de la Orden $sComboRead22 = GUICtrlRead($numoj);============================== Número de la orden $sComboRead23 = GUICtrlRead($delitocap);========================== Delito $sError = "" If $sComboRead1 = "" Then $sError &= "El Campo de la Fecha de hecho esta vacío"&@CRLF If $sComboRead1 > $date Then $sError &= "La fecha no puede ser superior al día de hoy"&@CRLF If $sComboRead2 = "" Then $sError &= "El Campo de la Hora esta vacío"&@CRLF If $sComboRead3 = "" Then $sError &= "El Campo de la Fecha de Fuente esta vacío"&@CRLF If $sComboRead3 > $date Then $sError &= "La fecha de fuente no puede ser superior al día de hoy"&@CRLF If $sComboRead4 = "" Then $sError &= "El Número de Fuente esta vacío"&@CRLF If $sComboRead5 = "" Then $sError &= "Datos de la dirección Incompletos"&@CRLF If $sComboRead6 = "" Then $sError &= "Datos de la dirección Incompletos"&@CRLF If $sComboRead8 = "" Then $sError &= "Datos de la dirección Incompletos"&@CRLF If $sComboRead9 = "" Then $sError &= "Datos de la dirección Incompletos"&@CRLF If $sComboRead12 = "" Then $sError &= "No Hay Punto Cardinal"&@CRLF If $sComboRead14 = "" Then $sError &= "Seleccione Tipo de Documento"&@CRLF If $sComboRead15 = "" Then $sError &= "Campo de Documento Vacío"&@CRLF If $sComboRead16 = "" Then $sError &= "Apellido Vacío"&@CRLF If $sComboRead17 = "" Then $sError &= "Nombre Vacío"&@CRLF If $sComboRead18 = "" Then $sError &= "Sexo Vacío"&@CRLF If $sComboRead19 = "" Then $sError &= "Fecha de nacimiento vacía"&@CRLF;=============== Pendiente lo del calculo de la fecha de nacimiento ============== If $sComboRead19 >= $date Then $sError &= "¿Que? Es que nació hoy? O no ha nacido?"&@CRLF If $sComboRead20 = "" Then $sError &= "Seleccione Tipo de Captura"&@CRLF If $sComboRead20 = "Flagrancia" And $sComboRead13 = "" Then $sError &= "Si es flagrancia, debe llevar número de noticia."&@CRLF If $sComboRead20 = "Orden Judicial" And $sComboRead21 = "" Then $sError &= "Si Es Orden Judicial Llene Los Datos De Forma Correcta Falta Fecha"&@CRLF If $sComboRead20 = "Orden Judicial" And $sComboRead22 = "" Then $sError &= "Si Es Orden Judicial Llene Los Datos De Forma Correcta Falta Número"&@CRLF If $sError = "" Then Run("notepad.exe") WinWait("Sin título: Bloc de notas") WinActivate("Sin título: Bloc de notas") Send($sComboRead1) Else MsgBox(16,"error",$sError,99,$Form1_1) EndIf EndSwitch WEnd on the other hand, I don't understand the question.1 point -
1 point
-
#include <IE.au3> $oIE = _IECreate("https://www.kijiji.it/miei-annunci/accedi", 0, 1, 1, 1) $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput In $oInputs If $oInput.name = "email" Then $oInput.value = "MyEmail@email.com" If $oInput.name = "password" Then $oInput.value = "MyPassword" If $oInput.type = "submit" Then ExitLoop _IEAction($oInput,"click") Next1 point
-
Or $sDir = @AppDataDir $sMsg = $sDir & @LF $sMsg &= _GetParentDir($sDir) & @LF $sMsg &= _GetParentDir($sDir, 2) & @LF MsgBox(262144, Default, $sMsg, 0) Func _GetParentDir($sDir, $nUpDirs = 1) Return StringLeft($sDir, StringInStr($sDir, "\", 0, $nUpDirs * -1) - 1) EndFunc ;==>_GetParentDir now, it's up to the RegEx freaks to show a RegEx solution.1 point
-
The ADB.EXE starts on your windows machine but triggers the remote daemon on your android phone (if android debugging is enabled) Ok first of all to do anything with android from windows you need adb.exe on your local windows machine which can be installed in about 15 seconds. http://forum.xda-developers.com/showthread.php?t=2588979 after you adb working you can do a lot of nice things from any programming language (including AutoIT) As a starter you can read thishttp://wiki.cyanogenmod.org/w/Doc:_adb_intro And after that you can read a lot on how to do some stuff from AutoIT where OP did make a nice start of wrapping up functions around adb.exe. ADB consists of https://android.googlesource.com/platform/system/core/+/master/adb/SERVICES.TXT This can be made a little more efficient by not making adb call each time but just start communicating directly As AutoIT is about sending keys, recognizing controls I started with these1. Make screenshot: ADB screencap makes a RAW screenshot, -p makes it PNG (making a lot of screenshots probably faster in RAW format) 2. Get the element hierarchy: ADB shell uiautomator dump <file> http://www.bdtool.net/third/android-doc/web-docs/tools/help/uiautomator/index.html 3. Get files from your phone to the pc with ADB pull 4. Put files to your phone with ADB push 5. sendevent / keys or getevent / record http://ktnr74.blogspot.nl/2013/06/emulating-touchscreen-interaction-with.html And with all above combined you can remotely control your android phone Technically I see no reason why you cannot maken an APK with help of AutoIT but probably a lot of work and nobody started such a project http://en.wikipedia.org/wiki/Android_application_package1 point