Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/15/2014 in all areas

  1. When ever you hover your mouse over a native function, user defined function, or an AutoItObject method then you will see the calltip for that function. Click "Like This" if you found this useful! To use this just place the following lua file in the "...AutoIt3\SciTE\lua" directory. MouseHoverCallTips.zip downloads:741 After you have done that then open SciTE and click 'Options' --> 'Open Lua Startup Script' and paste this line after the other lines (may require administrative rights): LoadLuaFile("MouseHoverCallTips.lua") Updates and changes:
    1 point
  2. And here is slightly modified version to distinguish code part for row and for column $html = '<tr><td>r1c1</td> <td>r1c2</td></tr> <tr><td>r2c1</td> <td>r2c2</td></tr> <tr><td>r3c1</td> <td>r3c2</td></tr>' $cols_on_row = 2 ; known number of columns $row = 0 $cols = StringRegExp($html, '(?s)(?i)<td>(.*?)</td>', 3) For $i = 0 to UBound($cols) - 1 $col = $cols[$i] If Mod($i,$cols_on_row) = 0 Then $row += 1 ConsoleWrite("Row " & $row & @CRLF) EndIf ConsoleWrite(" Col " & Mod($i,$cols_on_row) & ': ' & $col & @CRLF) Next Output:
    1 point
  3. Here is another parsing snipet optimized for speed, only with one StringRegExp() It's based on the premise of known number of columns. Number of columns ($cols_on_row) can be checked by StringRegExp() before main For/Next loop if needed. Rows needn't to be parsed by StringRegExp(), instead rows can be calculated by Mod() function. $html = '<tr><td>r1c1</td> <td>r1c2</td></tr> <tr><td>r2c1</td> <td>r2c2</td></tr> <tr><td>r3c1</td> <td>r3c2</td></tr>' $cols_on_row = 2 ; known number of columns $row = 0 $cols = StringRegExp($html, '(?s)(?i)<td>(.*?)</td>', 3) For $i = 0 to UBound($cols) - 1 $col = $cols[$i] If Mod($i,$cols_on_row) = 0 Then $row += 1 ConsoleWrite("Row " & $row & " Col " & Mod($i,$cols_on_row) & ': ' & $col & @CRLF) Next Output:
    1 point
  4. I couldn't get option=4 to work. Here's a slightly different approach. #include <Array.au3> Local $html = '<tr><td>r1c1</td> <td>r1c2</td></tr> <tr><td>r2c1</td> <td>r2c2</td></tr> <tr><td>r3c1</td> <td>r3c2</td></tr>' Local $aRes = StringRegExp($html, "(?isU)<tr>|(?:<td>)(.*)(?:</td>)", 3) _ArrayDisplay($aRes)
    1 point
  5. Well, not really sure, but here is a start point : #include <Array.au3> $html = '<tr><td>r1c1</td> <td>r1c2</td></tr> <tr><td>r2c1</td> <td>r2c2</td></tr> <tr><td>r3c1</td> <td>r3c2</td></tr>' $aRes = StringRegExp($html, "(?is)<tr.*?>.*?(?:<td.*?>(.*?)<\/td>\s*)(?=(?:<td.*?>(.*?)<\/td>)?).*?<\/tr>", 4) For $i = 0 To UBound($aRes) - 1 If IsArray($aRes[$i]) Then $tab = $aRes[$i] _ArrayDisplay($tab) EndIf Next _ArrayDisplay($aRes) I don't know why there is an empty last result... Edit : I use <td.*?> to match this king of tag : <td id='toto' ....> (so out of your example)
    1 point
  6. JLogan3o13

    gui embedded ie

    I use a similar script for my IP camera network at home. I'm at the office at the moment, but something like this should get you started: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <Misc.au3> Local $oIE1 = _IECreateEmbedded() Local $oIE2 = _IECreateEmbedded() $myGUI = GUICreate("Deal A Day Sites", 1000, 500, Default, Default, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $pic1 = GUICtrlCreateObj($oIE1, 10, 10, 400, 400) $pic2 = GUICtrlCreateObj($oIE2, 500, 10, 400, 400) _IENavigate($oIE1, "http://www.google.com") _IENavigate($oIE2, "http://www.yahoo.com") While 1 Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd
    1 point
  7. jguinch

    Regex exactly 15 digits

    So much posts for a so little issue... The question was about Regexp, so I just answered with a Regexp solution. Now, Melba, DarthCookieMonster and Guinness answered with a different way, which is the simplest way, the way of learning, the obvious way to progress with a script language. For these reasons, I think it's a good idea to provide these different solutions, for the asker's interest. A lot of us like to use Regexp, but it's a good thing to sometime make a "booster shot".
    1 point
  8. Melba23

    New MVPs

    And please extend your congratulations to Malkey as well - the invitation obviously took the slow boat to the Antipodes. M23
    1 point
  9. czardas

    Anagram game

    Been busy and haven't had time to test this, but I was thinking: wouldn't it be easier (and quicker) to use _ArrayBinarySearch() to look for possible alternative solutions? You could tell the user that the word does exist but it is not the answer. Also check your word list for dupes - people that compile these lists are sometimes a bit careless.
    1 point
  10. One thing you will learn is the fact SRE's are not always simple. I try to keep them as simple as possible but that won't always do the trick.
    1 point
  11. twinturbosubaru, You need to use a StringRegExp - which is not something you can pick up just like that! Here is an example of an SRE working: $sText = "blahblahblah" & @CRLF & _ "Email Address: fred@joebloggs.com" & @CRLF & _ "blahblahblah" $aAddress = StringRegExp($sText, "(?U).*Address:\s(.*)\v.*", 1) MsgBox(0, "Address", $aAddress[0])It works liek this: (?U) - look for the smallest number of characters to match .*Address:\s - look for any number of characters followed by "Address:" and a space (.*) - find the smallest number of characters before...(this is the bit we are looking for so it is in () \v.* - an EOL followed by any number of charactersAnd as you can see it only finds one such string - the address itself. If you post the sanitized text of an e-mail, we can refine the SRE further. M23
    1 point
×
×
  • Create New...