Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/17/2021 in all areas

  1. Put in brackets what you want to capture! Your regex101 clearly shows what you are capturing.
    1 point
  2. You really need to think about these things a little longer! You want to concatenate the content of that variable into the result string! Something like this? $var = "000000" ConsoleWrite(StringRegExpReplace($str, "(<\$test)\.\d{6}(>\h;;CODE2)", "$1." & $var & "$2") & @CRLF & @CRLF) "Jos
    1 point
  3. You mean something like this?: ConsoleWrite(StringRegExpReplace($str, "(<\$test)\.\d{6}(>\h;;CODE2)", "$1.000000$2") & @CRLF& @CRLF)
    1 point
  4. mLipok

    Oracle SQL db queries

    @Earthshine you are pointing to Net techniques which may (or not) rely on ADO. But in fact this is Net techniques. But there is Oracle COM Automation Feature which should be possible to use with AutoIt, as so far not tested/confirmed.
    1 point
  5. use my ADO.au3 UDF with this example ADO_TESTING__ jaja714_Oracle.au3 : ;~ https://www.autoitscript.com/forum/topic/205404-oracle-sql-db-queries/ #AutoIt3Wrapper_UseX64=N ;~ #AutoIt3Wrapper_UseX64=Y #include "ADO.au3" ;~ #include "..\..\ADO.au3" #Tidy_Parameters=/sort_funcs /reel #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <Array.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> ; SetUP internal ADO.au3 UDF COMError Handler _ADO_ComErrorHandler_UserFunction(_ADO_COMErrorHandler_Function) ; Uncomment one of the following examples ; _Example_MySQL('DataSource', 'UserName', 'Password', 'Select * ........') Func _Example_MySQL($service, $user, $pass, $sQUERY) ; https://www.connectionstrings.com/oracle/ ; https://www.autoitscript.com/forum/topic/205404-oracle-sql-db-queries/?do=findComment&comment=1477692 Local $sConnectionString = 'Provider=OraOLEDB.Oracle;Data Source=' & $service & ';User Id=' & $user & ';Password=' & $pass & ';' ;~ Local $sConnectionString = 'Provider=msdaora;Data Source=' & $service & ';User Id=' & $user & ';Password=' & $pass & ';' ;~ Local $sConnectionString = 'Driver={Microsoft ODBC Driver for Oracle};ConnectString=' & $service & ';Uid=' & $user & ';Pwd=' & $pass & ';' ;~ Local $sConnectionString = 'Driver={Microsoft ODBC for Oracle};Server=' & $service & ';Uid=' & $user & ';Pwd=' & $pass & ';' _Example_1_RecordsetToConsole($sConnectionString, $sQUERY) _Example_2_RecordsetDisplay($sConnectionString, $sQUERY) _Example_3_ConnectionProperties($sConnectionString) EndFunc ;==>_Example_MySQL #Region Common / internal Func _Example_1_RecordsetToConsole($sConnectionString, $sQUERY) ; Create connection object Local $oConnection = _ADO_Connection_Create() ; Open connection with $sConnectionString _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then Return SetError(@error, @extended, $ADO_RET_FAILURE) ; Executing some query Local $oRecordset = _ADO_Execute($oConnection, $sQUERY) ; Get recordset to array of arrays (Conent and ColumnNames) Local $aRecordsetArray = _ADO_Recordset_ToArray($oRecordset, False) ; Get inner array - only conent of Recordset Local $aRecordsetContent = _ADO_RecordsetArray_GetContent($aRecordsetArray) ; Go through the array variable (Recorset Conent) Local $iColumn_count = UBound($aRecordsetContent, $UBOUND_COLUMNS) For $iRecord_idx = 0 To UBound($aRecordsetContent) - 1 ConsoleWrite('==================================================================' & @CRLF) For $iColumn_idx = 0 To $iColumn_count - 1 ConsoleWrite($aRecordsetContent[$iRecord_idx][$iColumn_idx] & @CRLF) Next Next ; Clean Up $oRecordset = Null _ADO_Connection_Close($oConnection) $oConnection = Null EndFunc ;==>_Example_1_RecordsetToConsole Func _Example_2_RecordsetDisplay($sConnectionString, $sQUERY) ; Create connection object Local $oConnection = _ADO_Connection_Create() ; Open connection with $sConnectionString _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then Return SetError(@error, @extended, $ADO_RET_FAILURE) ; Executing some query directly to Array of Arrays (instead to $oRecordset) Local $aRecordset = _ADO_Execute($oConnection, $sQUERY, True) ; Clean Up _ADO_Connection_Close($oConnection) $oConnection = Null ; Display Array Content with column names as headers _ADO_Recordset_Display($aRecordset, 'Recordset content') EndFunc ;==>_Example_2_RecordsetDisplay Func _Example_3_ConnectionProperties($sConnectionString) ; Create connection object Local $oConnection = _ADO_Connection_Create() ; Open connection with $sConnectionString _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then Return SetError(@error, @extended, $ADO_RET_FAILURE) ; Get all connection properties to Array Local $aProperties = _ADO_Connection_PropertiesToArray($oConnection) ; Clean Up _ADO_Connection_Close($oConnection) $oConnection = Null ; Show connection properties _ArrayDisplay($aProperties, "ADO connection - List of properties", "", 0, Default, "Name|Type|Value|Attributes") EndFunc ;==>_Example_3_ConnectionProperties #EndRegion Common / internal and if something will be wrong send here console output (of course anonymize them before sending).
    1 point
  6. An owner drawn listview supports multi-line items through the LVS_OWNERDRAWFIXED style. FIXED means that it's only possible to set a certain height for all listview items. This common height is set during creation of the listview. You probably want to set individual heights for each listview item. But this is simply not possible for a standard listview control available in AutoIt. But other controls supports individual heights on a per-item basis. These are comboboxes and listboxes through the CBS_OWNERDRAWVARIABLE and LBS_OWNERDRAWVARIABLE styles, respectively. VARIABLE means that you can set individual heights on a per-item basis. If you want to use individual item heights then the only option is to rewrite the code to support e.g. a listbox control. But it'll complicate the owner draw code for multi-line items in that you'll need multiple text rectangles in the same listbox item corresponding to each subline. A simpler solution to the problem could be to simulate multi-line listview items using one listview item for each subline. This could be done by simply adding an additional listview column with item numbers as shown in the figure: For multi-line items, the item number is only filled in for the first subline. The advantage of this approach is that all existing owner draw code can be reused. You probably still need additional code to handle the multi-line items depending on what functionality you want. But this can in all likelihood be done through an array index to keep track of these multi-line items. I've made a note about simulating multi-line listview items in this way because it might be interesting to investigate the technique. So I might be able to help with some code. But it probably won’t be until the Easter holidays.
    1 point
  7. If you need to check if a script in a3x format is running, the following function can be used: #Region Includes #include <WinAPIProc.au3> #EndRegion Includes #Region Main _Main() Func _Main() Local $boExists = _ProcessExists_A3X("Example.a3x") MsgBox(0, "A3X-Check", "Count: " & @extended & @TAB & $boExists) EndFunc ;==>_Main #EndRegion Main #Region Functions Func _ProcessExists_A3X($sProcess, $iReturn = 0) ;--------------------------------------------------------------------------------------------------------------- ; Get process list and create string containing process name & ID ;--------------------------------------------------------------------------------------------------------------- Local $aProcessList = ProcessList(), $sProcessList, $iProcess If @error Then Return SetError(0x01, "", False) For $iProcess = 1 To UBound($aProcessList) - 1 $sProcessList &= $aProcessList[$iProcess][0] & "|" & $aProcessList[$iProcess][1] & @CRLF Next ;--------------------------------------------------------------------------------------------------------------- ; Get window list ;--------------------------------------------------------------------------------------------------------------- Local $aWinList = WinList("[class:AutoIt v3]", "") If @error Then Return SetError(0x02, "", False) ; Loop trough all windows Local $iWindow Local $aCmdLine, $sCmdLine Local $iCount For $iWindow = 0 To UBound($aWinList) - 1 ; Get process belonging to windows $iProcess = WinGetProcess($aWinList[$iWindow][1]) If $iProcess < 0 Then ContinueLoop ; Find process name in list StringRegExpReplace($sProcessList, "(?ms).*\r\n([^\|]+)\|" & $iProcess & "\b.*", "$1", 0) If Not @extended Then ContinueLoop ; Get command line as it should contain filepath $sCmdLine = _WinAPI_GetProcessCommandLine($iProcess) $aCmdLine = StringRegExp($sCmdLine, ".*\Q" & $sProcess & "\E.*", 3) If @error Then ContinueLoop $iCount += 1 Next If $iCount Then Return SetExtended($iCount, True) Return SetError(0x03, 0, False) EndFunc ;==>_ProcessExists_A3X #EndRegion Functions
    1 point
  8. Jon

    Forum Rules

    We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.
    1 point
×
×
  • Create New...