Jump to content

rony2006

Active Members
  • Posts

    196
  • Joined

  • Last visited

Everything posted by rony2006

  1. Yes, you are right. Sorry. But anyway I didnt knew until now that i need to put "execute". Thanks!
  2. Thanks a lot. you saved me at least 1 hour.
  3. is true, but we use a remote MySQL database, multiple people use this software and sometimes they work on same sheet of checkboxes so there should be some sync between them.
  4. No because the array is 0 based. Look at the pic. [3][0] is the name of checkbox and [3][1] tells me if i should set it checked or unchecked.
  5. Hello, In my gui i have 90 checkboxes that I read and I store their value in a MySQL database. In this way I am able to save state of each checkbox. Now I also need to be able to read what is in database stored and then check or uncheck the boxes. For $iz = 3 To $iRows - 1 if $linknew11a[$iz][1] = "True" Then GUICtrlSetState($linknew11a[$iz][0], $GUI_CHECKED) EndIf Next $linknew11a[$iz][0] - tell me if the checkbox is True (checked) or False (Unchecked). $linknew11a[$iz][1] - is the controlID of the checkbox (including $ sign). The problem is that GUICtrlSetState($linknew11a[$iz][0], $GUI_CHECKED) doesnt work because instead of $linknew11a[$iz][0] which basically is the string of controlID and I need to somehow convert this string into the real variable of the controlID. Any ideas how I can do this? If not I will need to write 90 times the if condition...
  6. Thanks, I found a working example for this and I adapted to my code: #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Purple Sheets", 376, 550, -1,-1) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $ListViewExp = GUICtrlCreateListView("", 8, 16, 106, 382, $LVS_SHOWSELALWAYS) $ListViewLind = GUICtrlCreateListView("", 130, 16, 106, 382, $LVS_SHOWSELALWAYS) $ListViewScott = GUICtrlCreateListView("", 256, 16, 106, 382, $LVS_SHOWSELALWAYS) _GUICtrlListView_AddColumn($ListViewExp, "Expected", 85) _GUICtrlListView_AddColumn($ListViewLind, "Lindsey", 85) _GUICtrlListView_AddColumn($ListViewScott, "Scott", 85) _GUICtrlListView_AddItem($ListViewExp, "testing1", 0) _GUICtrlListView_AddItem($ListViewLind, "testing2", 0) _GUICtrlListView_AddItem($ListViewScott, "testing3", 0) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ;~ Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($ListViewExp)] GUISetState(@SW_SHOW) While 1 Sleep (100) Wend Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView1 = GUICtrlGetHandle($ListViewExp) $hWndListView2 = GUICtrlGetHandle($ListViewLind) $hWndListView3 = GUICtrlGetHandle($ListViewScott) ;~ If Not IsHWnd($ListViewExp) Then $hWndListView = GUICtrlGetHandle($ListViewExp) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView1 Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $text = _GUICtrlListView_GetItemText ($ListViewExp, DllStructGetData($tInfo, "Index")) MsgBox (0, "you clicked on", $text) EndSwitch Case $hWndListView2 Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $text = _GUICtrlListView_GetItemText ($ListViewLind, DllStructGetData($tInfo, "Index")) MsgBox (0, "you clicked on", $text) EndSwitch Case $hWndListView3 Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $text = _GUICtrlListView_GetItemText ($ListViewScott, DllStructGetData($tInfo, "Index")) MsgBox (0, "you clicked on", $text) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _Exit () Exit EndFunc
  7. Hello, In my script i have 2 different listview and I need for each of them to trigger different functions for double click on listview item. Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ;~ Local $tBuffer $hWndListView = $lista_poze If Not IsHWnd($lista_poze) Then $hWndListView = GUICtrlGetHandle($lista_poze) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView if $iCode = $NM_DBLCLK Then $lapofilename = _GUICtrlListView_GetItemText($lista_poze, _GUICtrlListView_GetHotItem($lista_poze)) shellexecute(@ScriptDir & "\Dosare\" & GUICtrlRead($nr_inmatriculare) & "\Poze\Initiale\Resize\" & $lapofilename) EndIf if $iCode = $NM_CLICK Then $lapofilename = _GUICtrlListView_GetItemText($lista_poze, _GUICtrlListView_GetHotItem($lista_poze)) ;msgbox(0, "", $lapofilename) ;shellexecute(@ScriptDir & "\Dosare\" & GUICtrlRead($nr_inmatriculare) & "\Poze\Initiale\Resize\" & $lapofilename) GUICtrlSetImage($imagine, @ScriptDir & "\Dosare\" & GUICtrlRead($nr_inmatriculare) & "\Poze\Initiale\Resize\" & $lapofilename) EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY This code works good for list $lista_poze but I have another list and I dont know how to integrate it in WM_notify. How can I make $hWndListView to accept 2 different listviews?
  8. Hi, How I can use this to predict middle words? My array contains strings like "word1 another" If I write "wor" then the string gets predicted and is fine, but how I can predict same string by typing "anot" for example (first letters from 2nd word from the string). Thanks!
  9. Hi, Sorry if has been discussed already but I have no idea what to search for. I have a small project for someone that want a software to be able to fill some forms and then to generate a PDF with data from the forms. The PDF should have a standard format. I was thinking to do an Excel template and then using Autoit Excel functions to write data to it and save it as a PDF file. The problem is that I need somehow to hide that excel template. I can have an .au3 or .exe file and a folder where I put all resources but I dont want to let other people by themselves to edit the template and to generate other kind of PDF. I am thinking if is possible to convert the excel template into a string, store the string inside a text file and when software is using it to convert the string back to excel and then to delete it after PDF is generated. What do you think?
  10. Thanks @Melba23 I implemented and it seams that it works but there is a issue: I dont get actually the row select the same as I click on it (the blue color). But row is getting selected some how because on my list I have only 10 rows available without scroll. If i sent _GUIListViewEx_SelectItem(15), my list automatically scrolls so I will have item 15 on the screen visible. I disabled _GUIListViewEx_LoadColour() but the effect is the same. I am using 2 listview on the gui. And also i used _GUIListViewEx_SetActive($iLVIndex_1) before the function. I will try to make a simple script to show you the issue.
  11. Hello, I am using _GUIListViewEx to display a list with some elements. I was able to double click on a element and get the row of selected item. Now I need to select a row, without double click, meaning I need to be able programmatically to select a item in the list. I dont think I can use colors because my list is already colored based on values from cells. I tried to change the color of a specific row, but then when i change the color of the next one, the previous one doesnt reset his color to the color set by the value. Is there an equivalent of the following? _GUICtrlListView_SetItemSelected($idListview, 1)
  12. Sorry i think i didnt explained correctly. Let me give another example: I have a slider, minimum value return by slider is 0 and maximum value returned by slider is 100. I have a car that have a speed between 20 km/h (minimum) and 120 km/h maximum. In my function I will input 20 as min and 120 as max (considering that 0 and 100 are always standard). Now I will move my slider at a value of 64 (as I said, slider can go from 0 to 100), and I want to have the speed of my car. How I can calculate this?
  13. Hi, I dont remember what is the name of an AutoIT function that allows you to set a value to another value. For example I have 2 variables: a = 4 and b = 14 this function allows me to say that 4 = 0 and 14 = 100 then if i would use the function value of 50, my return value is the middle between 4 and 14. Sorry if i didnt explained it correctly.
  14. Hello, I have a problem: Basically i want to sort a 2d array using one column that contains numeric values. My code looks like this: For $iz = 1 To UBound($CCinvoices) -1 $CCinvoices[$iz][1] = StringReplace($CCinvoices[$iz][1], " ", "") $CCinvoices[$iz][1] = Number($CCinvoices[$iz][1]) Next _Arraydisplay($CCinvoices, "$CCinvoices") _ArraySort($CCinvoices, 1, 0, 0,1) _Arraydisplay($CCinvoices, "$CCinvoices") This is how array looks before sorting. After i sort the array, I got the following result: As you see 227.21 was sorted after 29.79 so i dont know why i got this. I tried the following solutions: 1) Removing blank spaces 2) Converting strings to Number before sorting. Any ideas?
  15. #include <Array.au3> $iRequiredSum = 3591226 Global $aArray = [1378908,1634314,15713665,1149042,1797187,18754341,1429697,1509035,13257814,1811223,1508925,13817384,2100215,1540744,12836514,1616225,1444406,12190430,1653099,620083,4901735] Global $Valori[1][3] ; Increase the number of factors on each pass For $iSet = 1 To UBound($aArray) ; Determine the possible combinations $aCombinations = _ArrayCombinations($aArray, $iSet, "+") ; For each combination For $j = 1 To $aCombinations[0] ; Break into factors $aFactors = StringSplit($aCombinations[$j], "+") ; Sum factors $iSum = 0 For $k = 1 To $aFactors[0] $iSum += $aFactors[$k] Next ConsoleWrite($j & @crlf) if abs($iRequiredSum - $iSum) < $iRequiredSum / 4 Then _ArrayAdd($Valori, $aCombinations[$j] & "=" &$iSum & "=" & abs($iRequiredSum - $iSum), 0,"=") endif ; If sum is required value Next Next ;_ArraySort($Valori, 0, 0, 0, 2) ;_arraydisplay($Valori) exit #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object and create a new workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookNew($oExcel) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf ; Write a part of a 2D array to the active sheet in the active workbook ;Local $aArray2D[3][5] = [[11, 12, 13, 14, 15], [21, 22, 23, 24, 25], [31, 32, 33, 34, 35]] _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $Valori, "B1") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 3", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 3", "2D array successfully written.") I adjusted the code to fit my needs but I noticed 2 problems: If I store the resulted sum in a array and then I sort that array to get the smallest different then sorting is not correct. Another things is that is taking a lot of time to calculate. I added there a condition that the array should be filled only if the difference is smaller then 25% of the required sum but still didnt improved a lot the speed. Current code finished filling the array in >Exit code: 0 Time: 479.3 Any ideas?
  16. I found this code by @Melba23 but it looks only for combinations that will give the exact number not the closest: #include <Array.au3> $iRequiredSum = 12 Global $aArray = [7, 8, 5, 3, 2, 1, 4, 6] ; Increase the number of factors on each pass For $iSet = 1 To UBound($aArray) ; Determine the possible combinations $aCombinations = _ArrayCombinations($aArray, $iSet, "+") ; For each combination For $j = 1 To $aCombinations[0] ; Break into factors $aFactors = StringSplit($aCombinations[$j], "+") ; Sum factors $iSum = 0 For $k = 1 To $aFactors[0] $iSum += $aFactors[$k] Next ; If sum is required value If $iSum = $iRequiredSum Then ; Write caombination ConsoleWrite($aCombinations[$j] & " = " & $iRequiredSum & @CRLF) EndIf Next Next Any idea how i can adjust that to give me the most closest values to $iRequiredSum
  17. Hi, I try to develop a software and I need a algorithm that will return me the smallest difference between a number (X) and a list of number (array): https://i.imgur.com/dOevZQr.png In my example, if I make a sum between number G and number M I will get smallest difference to the number X (3,591,226.64). I want to input a array with numbers and to give the value of X. The script should give me the most closer combination of number to the value of x. From the array I can use 1, 2 or multiple values to make the sum to be compared with X. The difference can be both positive or negative, the idea is to be much closer to X value. Any help will be appreciated (I am willing to pay also for this). Regards,
  18. Hello, In my project again I saw that is necessary for me to get the table returned by a mysql procedure so any help will be appreciated. I am willing to pay somebody just to show me how to solve my problem.
  19. Hello, Your UDF can call SQL procedures? Please see my topic:
  20. Hello, I am using a lot Autoit to make some SELECT/INSERT operation on a Mysql database using this UDF made by @Yoriz who is similar with the udf made by @ProgAndy : No problem until now using _EzMySql_GetTable2d Now I have created in Mysql a procedure that i want to call with autoit and to get a 2d array. The sql statment is: "CALL sp_GetResultByDate('2018-01-02', '2018-01-02');" If i run the statement on Adminer on another server (not localhost) I get the table: But If I run with Autoit I get the following error: My code is: If Not _EzMySql_GetTable2d("CALL sp_GetResultByDate('2018-01-02', '2018-01-02');") Then MsgBox(0, "Query Error", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf Can anybody help me please?
  21. Hello, Is there any AutoIT script + a php script that allows a user to click a button in a web page and then will start a autoit function on a server?
  22. Thank you. Looks like is working and I saw what is the logic behind it so I applied it to get also other data. #include <String.au3> #include <Array.au3> Global $sXML = FileRead('xmlfile2.xml') Global $aMatches = _StringBetween($sXML, '<cfdi:Comprobante', '<cfdi:Emisor') If @error Then MsgBox(0, 'Error', 'container not found.') Global $sMatch1 = $aMatches[0] Global $aUUID = _StringBetween($sMatch1, 'serie="', '"') If @error Then MsgBox(0, 'Error', 'string not found.') Global $sUUID = $aUUID[0] MsgBox(0, 'result', $sUUID)
  23. Hello, I have the following xml file: <?xml version="1.0" encoding="utf-8"?> <cfdi:Comprobante xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tfd="http://www.sat.gob.mx/TimbreFiscalDigital" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cfdi="http://www.sat.gob.mx/cfd/3" version="3.2" serie="AFAD" folio="156" fecha="2017-11-08T14:55:27" sello="Z5UgoQLYj+eAj3LGqwObJp7q+DXazvMC8jgfhgf" formaDePago="Pago en una sola exhibición" noCertificado="00001000000406658711" certificado="MIIGFjCCA/6gAwIBAgIUMDAwMDEwMDAwMDA0MDY2NTg3MTEwDQYJKoZIhvcNAQELBQAwggGyMTgwNgYDVQQDDC9BLkMuIGRlbCBTZXJ2aWNpbyBkZSBBZG1pbmlzdHJhY2nDs24gVHJpYnV0YXJpYTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cmlkYWQgZGUgbGEgSW5mb3JtYWNpw7NuMR8wHQYJKoZIhvcNAQkBFhBhY29kc0BzYXQuZ29iLm14MSYwJAYDVQQJDB1Bdi4gSGlkYWxnbyA3NywgQ29sLiBHdWVychgfgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAplsw+drENNc3zPFq+FZN0s/0lwmoECUNc27Y4DC4HC2gjbDQR5i+ZfXxsRkiNuKFtHhhatu4htzKOonlbo5/sb99OGG/XhXG2MNGLUgnvmNyWptXaCYKeSSDMlJ3b1/LsaQxu9U2k1crWS4Ut9HJkQF0Eo6Lblnw8l4zGn5ikvFuAeMVcZdQdh0TTBPMuhh0VF7/PyOGFuE50i/51sMVTZRtshwDGMqEqCbhF/SXsUWNMcX6OWIQAHyrAWGZT2HpcGXBVvq0Ljw8CGfdGWFJMQ20z/sdbH/ypP/CSl8bHPS5wo2Uu8aFY+VCZki6kKIU2vxz9hJBXFxW/XK/rZR0BQIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAgEAaexWNAFeycqwOSumk8T20Iplv5djMR0JSFn37T0KK+dmlw3aYvCrwZH3/T1kyV2916yhZvnQxaIne3+Wb/k8FWykvPbYM369/QcxZCJjtZ9tCFihztKsWDrBGV/gRtxLtkn5fKgRCo7bMRdwi0SloeAjPO4JppD+/pFDmbt1h8sT/4UpZ7gBE3XQyiwfwySX4ZH2AYMzAEGhwvLFWkXym3T7bd6YY7QMgqrbzYKUQflRtAqxQdnQx6NFXzcBNYqtPhVGJ6CNiL141WFio6C8//FVy1RCQxdKOmGKXYO3f2qZ5R/tgJvydJiSFuUxjMCLY28F140J7xrW08eUgZCvnMvMtMJwz545c/tWLrHQahqOGaszDFgnlAfH4JkZdv+1ma2A1ZP+pT2aSMHyww9qIAN3jBVi1GQdEUDDCbPYQTP7eNBgH5MHs7gTn+Of9YPFYPFxDdHjHUJBVn9BOu10K06uBZAutEW2Bt6Obk1XWhu1oFG3OnEa7SX0Stpn+QWABwgYLxZTzMaPUzQ6PYR4wRGSM7Un2IKbNRLqJ4mRXlsYqPytjsnEn41qfnIJ+ZB2MtCCZbks3S89D2CnvXW5oOnuCCl0C6+sJge71YAJo4hPQ/hSNFVDqZci57/1UZ4MTyLKl4c4lzCIv6ryPEw/fq7Uw/+7zYKsMX80m8y5sdQ=" subTotal="601894.079825" descuento="0.00" TipoCambio="1" Moneda="MXN" total="698197.132597" tipoDeComprobante="ingreso" metodoDePago="03" LugarExpedicion="Deleg. B5r43t4éxico" xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd"> <cfdi:Emisor rfc="DIgfdV4" nombre="DeeFGGGFDC.V."> <cfdi:DomicilioFiscal calle="CaREW" noExterior="NBVCVNBV57 A" noInterior="REW" colonia="6546" municipio="543" estado="MNBMNB" pais="8987" codigoPostal="987897" /> <cfdi:RegimenFiscal Regimen="76e9987" /> </cfdi:Emisor> <cfdi:Receptor rfc="CNC140563677828PQ4" nombre="JHGJHG"> <cfdi:Domicilio calle="G54" noExterior="32" colonia="JHG" municipio="De7654" estado="YTGHF65" pais="México" codigoPostal="01780" /> </cfdi:Receptor> <cfdi:Conceptos> <cfdi:Concepto cantidad="1" noIdentificacion="20171105M004IE1-A12050" unidad="No aplica" descripcion="Devolución del sobrecobro por pérdidas marginales en el MDA a los exportadores" valorUnitario="17035.72" importe="17035.72" /> <cfdi:Concepto cantidad="1" noIdentificacion="20171105M004IE1-A15050" unidad="No aplica" descripcion="Excedente de la liquidación de los DFT en el MDA a exportadores" valorUnitario="8770.42" importe="8770.42" /> <cfdi:Concepto cantidad="753" noIdentificacion="20171105M004IE1-B02050" unidad="MWh" descripcion="Compra de la energía para exportación en el MTR" valorUnitario="765.057025" importe="576087.939825" /> </cfdi:Conceptos> <cfdi:Impuestos totalImpuestosTrasladados="96303.052772"> <cfdi:Traslados> <cfdi:Traslado impuesto="IVA" tasa="16.00" importe="96303.052772" /> </cfdi:Traslados> </cfdi:Impuestos> <cfdi:Complemento> <tfd:TimbreFiscalDigital xmlns:tfd="http://www.sat.gob.mx/TimbreFiscalDigital" version="1.0" UUID="4CA1B7YTR8B3-A1EA-5CC45629B5AC" FechaTimbrado="2017-11-08T14:55:28" selloCFD="Z5UgoQLYj+eAj3LGqwOYTRFfxrp2mMzU46li/PnhGkXjGteJURuGGcWE6mevjlSGTMtVsDp7KiP654qFEwwQDedchLZaPWXA/aiqA4x1zLADe46fv+GKDcjQAq3AlL5jeWykQAUgQ0sCqcUTI8na+dmq41t3KMoGwWR3jNiqMkCDS64fBkVkd5Po4TxA0XMx+V2uAu0sXItdVZRIrxljsLRmhlkzPZV1dv5o1YL850z3abv6MVkWjCXFtCsFUShbDDWm6OZsltwCtO/ZfIKyqI6Jy/u6pucUUPdB+a1vrSs0EoqLZunBBVHOGL+sq0mPnuHi+O5oOA==" noCertificadoSAT="00001000000403038987" selloSAT="tY6BzU33nmKJHG+6d6J5WTKuvYCp0NaBt4VaC20srZfA876k/dRLHTycKYsZpm3YBFcW/ZTAU+U4GfjCcWLXP8eYG9EkNQRPEsCDHUe+DWplJ2ITBLDJRyCP4xiJK7URPo3png/N1bz3LmKymm+AEGe10PdsUcZZLQVxjJPl6WLckeoDaCrFJGxB8lt9yl0I2gfO/wxDzMBtEnwkKT/4thO89Weau+gSyBtZ0DOEVikCJehe5Tmr1YJUkCULwgXek6mvj7TLqlJaJces+jD0QCRxAvxZYS0q27fTFcTfeTDu1bMcPWXSdI8ZCUfM5ygVd85LQi5BGgNFR87xA==" xsi:schemaLocation="http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/TimbreFiscalDigital/TimbreFiscalDigital.xsd" /> </cfdi:Complemento> <cfdi:Addenda> <ad:ADENDAS xmlns:ad="http://www.addenda.com"> <ad:CAB LABEL="CABADD" TIPO_DOC="1" CODIGO_FUF="20171105M004IE1P00" PERIODO_ECD="2017-11-05" FECHA_LIM_PAGO="2017-11-15" ID_PARTIC_CENACE="M004IE1" BANCO="BBVA Bancomer, S.A." SUCURSAL="70" CUENTA="0104888553" CLABE="012180001048885534" REF_BANCO="20171105M004IE1P00" CONTACTO="ja,MN" IMPORTE_TOTAL="698197.14 " MONTO_LETRA="Seiscientos noventa y ocho mil ciento noventa y siete pesos y catorce centavos"> <ad:Conceptos> <ad:LINEA LABEL="LINADD" NUM_LIN="1" FOLIO_UNICO="20171105M004IE1-A12050" CONCEPTO="Devolución del sobrecobro por pérdidas marginales en el MDA a los exportadores" CANTIDAD="1" UNIDAD="N/A" PRECIO_UNIT="17035.72 " IMPORTE_LINEA="17035.72" IVA="2725.72" TOTAL="19761.44" /> <ad:LINEA LABEL="LINADD" NUM_LIN="2" FOLIO_UNICO="20171105M004IE1-A15050" CONCEPTO="Excedente de la liquidación de los DFT en el MDA a exportadores" CANTIDAD="1" UNIDAD="N/A" PRECIO_UNIT="8770.42 " IMPORTE_LINEA="8770.42" IVA="1403.27" TOTAL="10173.69" /> <ad:LINEA LABEL="LINADD" NUM_LIN="3" FOLIO_UNICO="20171105M004IE1-B02050" CONCEPTO="Compra de la energía para exportación en el MTR" CANTIDAD="753" UNIDAD="MWh" PRECIO_UNIT="765.06 " IMPORTE_LINEA="576087.94" IVA="92174.07" TOTAL="668262.01" /> </ad:Conceptos> </ad:CAB> </ad:ADENDAS> </cfdi:Addenda> </cfdi:Comprobante> I try to get the value for UUID from TimbreFiscalDigital. #include <MsgBoxConstants.au3> Local $xmlPath = @ScriptDir & '\xmlfile2.xml' If Not FileExists($xmlPath) Then Exit $file = FileRead($xmlPath) $file = StringReplace($file, @LF, '') $file = StringSplit($file, @CR, 1) Global $UUID_XML = XMLget($file, 'cfdi:Comprobante\cfdi:Complemento\tfd:TimbreFiscalDigital\UUID') MsgBox($MB_SYSTEMMODAL, "jhgjhg", $UUID_XML) Func XMLget($file, $Path); XMLget($file,'adc_database\currentconditions\realfeel') $Path = StringSplit($Path, '/\|', 0) $lastline = 0 For $lvl = 1 To $Path[0] Step 1 For $line = $lastline To $file[0] Step 1 $lastline = $line $hstart = StringInStr($file[$line], '<' & $Path[$lvl] & '>', 0) $hstarta = StringInStr($file[$line], '<' & $Path[$lvl] & ' ', 0) If $hstart Or $hstarta Then If $lvl == $Path[0] Then If $hstart Then $end = StringInStr($file[$line], '</' & $Path[$lvl] & '>', 0) If $end Then $hstart = $hstart + StringLen('<' & $Path[$lvl] & '>') Return StringMid($file[$line], $hstart, $end - $hstart) EndIf EndIf If $hstarta Then $end = StringInStr($file[$line], '/>', 0) If $end Then $hstarta = $hstarta + StringLen('<' & $Path[$lvl] & ' ') $return = StringMid($file[$line], $hstarta, $end - $hstarta) Return $return EndIf $ends = StringInStr($file[$line], '>', 0) If $ends Then $hstart = $ends + 1 $end = StringInStr($file[$line], '</' & $Path[$lvl] & '>', 0) If $end Then $return = StringMid($file[$line], $hstart, $end - $hstart) Return $return EndIf EndIf EndIf EndIf ContinueLoop 2 EndIf Next If $line == $file[0] Then ExitLoop Next Return 'not found' EndFunc ;==>XMLget But the value is not returned. If I use just: Global $UUID_XML = XMLget($file, 'cfdi:Comprobante\cfdi:Complemento\tfd:TimbreFiscalDigital\') Then I get a long string with all the data from TimbreFiscalDigital. I tried to use functions like Global $UUID = StringTrimRight (StringTrimLeft($UUID_XML, 74), 902) ; Remove the 5 leftmost characters from the string. to get the exact data that I want, but the problem is that sometimes other data is longer or shorter and I don't get exactly what I want. How can I get the exact value for UUID from TimbreFiscalDigital? Any help is appreciated!
  24. Hello, I need a highly experienced AutoIT freelancer. I have many project and I need some help. You need to have experience with CSV, XML files, MySQL .etc I am looking at persons with lower rates. Contact: cm.mechatronics@gmail.com or skype rony_sb92
  25. @Melba23 Hello, Can you tell me please how can I add grinds to a listview? I tried the following code but nothing happens: $lista = _GUICtrlListView_Create($D2E_v01, "",20,130,650,444,BitOR($LVS_DEFAULT,$LVS_EX_GRIDLINES))
×
×
  • Create New...