Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/23/2024 in all areas

  1. Nine

    AutoIt3 syntax mania

    There is also an undocumented bug about this notation that one must be aware of : $t.c(2) = 123 ConsoleWrite($t.c(2) & @CRLF) $i = 2 $t.c($i) = 321 ; does not work ConsoleWrite($t.c(2) & @CRLF) $t.c(($i)) = 321 ; now works ConsoleWrite($t.c(2) & @CRLF)
    1 point
  2. genius257

    AutoIt3 syntax mania

    And a silly one: Keywords like Null and Default MUST be followed with a space, when followed by operators like & and + $x = Null+1; ConsoleWrite($x&@CRLF) test.au3 (76) : ==> Missing separator character after keyword.: $x = Null+1 $x = Null^ ERROR Au3Check will not detect this error. Tested with 3.3.16.1
    1 point
  3. genius257

    AutoIt3 syntax mania

    And here is an undocumented feature i personally love ❤️ $t = DllStructCreate("INT a;INT b;INT c[3];") ; DllStruct values can used via dot notation $t.a = 123 ConsoleWrite($t.a & @CRLF) ; But i recently discovered this also applies to indexed elements: ConsoleWrite($t.c(2) & @CRLF) $t.c(2) = 123 ConsoleWrite($t.c(2) & @CRLF)
    1 point
  4. argumentum

    AutoIt3 syntax mania

    Return Value: The amount of data written. So ( 5 = 5 ) is True.
    1 point
  5. Roboto Mono works well for me, but I'm not too picky...
    1 point
  6. pixelsearch

    Simple Google Translate

    Here is a pic of the reworked script, it should be finished in a few days. Maybe I should open a new topic for this, or continue here ?
    1 point
  7. another approach ; https://www.autoitscript.com/forum/topic/211902-code-to-obtain-only-the-first-file-of-the-a-lot-of-folders/ #include <File.au3> _FindAllDir(@MyDocumentsDir) ;---------------------------------------------------------------------------------------- Func _FindAllDir($dir) If StringRight($dir, 1) <> "\" Then $dir &= "\" $ArraySrtfiles = _FileListToArrayRec($dir, "*", $FLTAR_FOLDERS, $FLTAR_RECUR) If Not IsArray($ArraySrtfiles) Then ConsoleWrite($dir & " = Invalid input path" & @CRLF) Return Else Local $sResult For $x = 1 To $ArraySrtfiles[0] ;ConsoleWrite($dir & $ArraySrtfiles[$x] & @CRLF) $sResult = _FindAllFile($dir & $ArraySrtfiles[$x], "*.txt") If Not @error Then ConsoleWrite($sResult & @CRLF) Next EndIf EndFunc ;==>_FindAllDir ;---------------------------------------------------------------------------------------- Func _FindAllFile($dir, $FileMask) $ArraySrtfiles = _FileListToArrayRec($dir, $FileMask, $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_SORT) If Not IsArray($ArraySrtfiles) Then Return SetError(1, 0, "") Else Local $sResult For $x = 1 To $ArraySrtfiles[0] $sResult = $dir & $ArraySrtfiles[$x] Return $sResult Next EndIf EndFunc ;==>_FindAllFile ;----------------------------------------------------------------------------------------
    1 point
  8. WARNING: Please notice: #REMARK this script works properly only with DRIVER ;~ $oADODB_Connection.Open("DRIVER=SQL Server;SERVER=localhost\SQLExpress;uid=sa;pwd=" & $sPassword & ";") $oADODB_Connection.Open("DRIVER=SQL Server Native Client 11.0;SERVER=localhost\SQLExpress;uid=sa;pwd=" & $sPassword & ";") #REMARK and not wtih PROVIDER ;~ $oADODB_Connection.Open("PROVIDER=SQLOLEDB.1;SERVER=localhost\SQLExpress;uid=sa;pwd=" & $sPassword & ";") ;~ $oADODB_Connection.Open("PROVIDER=SQL Server Native Client 11.0;SERVER=localhost\SQLExpress;uid=sa;pwd=" & $sPassword & ";") using PROVIDER you will hit the problem that only first PRINT : Local $sQuery = _ "BEGIN TRY" & @CRLF & _ " PRINT ' WATCH: BEFORE_ERROR'" & @CRLF & _ " RAISERROR ( '?????', 19, 1 )" & @CRLF & _ " PRINT ' WATCH: AFTER_ERROR'" & @CRLF & _ "END TRY" & @CRLF & _ "" & @CRLF & _ "BEGIN CATCH" & @CRLF & _ " PRINT ' WATCH: CATCH_START';" & @CRLF & _ " PRINT ' : NUMBER=' + CAST(ERROR_NUMBER() AS VARCHAR) + ' : SEVERITY=' + CAST(ERROR_SEVERITY() AS VARCHAR) + ' : STATE=' + CAST(ERROR_STATE() AS VARCHAR) + ' : LINE=' + CAST(ERROR_LINE() AS VARCHAR) + ' : MESSAGE=' + ERROR_MESSAGE();" & @CRLF & _ " PRINT ' WATCH: CATCH_END';" & @CRLF & _ "END CATCH;" & @CRLF & _ "" Will be outputed to console by __ADO_EVENT__InfoMessage() I think that this is some kind of limitation how events are captured by PROVIDER.
    1 point
  9. You mean something like this? #include <GuiConstants.au3> #include <GuiConstantsEx.au3> #include <FileConstants.au3> #include <EditConstants.au3> GuiCreate('Drag and Drop', 700, 600, @DesktopWidth / 2 - 192, _ @DesktopHeight / 2 - 235, -1, $WS_EX_ACCEPTFILES) GUICtrlCreateGroup("Dict Files", 5, 5, 570, 90) GUICtrlCreateLabel('Select file:', 20, 30) $dropFile = GUICtrlCreateInput ("", 120, 30, 200, 20, -1, $WS_EX_STATICEDGE) GUICtrlSetState (-1, $GUI_DROPACCEPTED) GUICtrlSetTip (-1, 'You can drag & drop files here...') GUICtrlCreateLabel('Select file:', 20, 60) $dropFile = GUICtrlCreateInput ("", 120, 60, 200, 20, -1, $WS_EX_STATICEDGE) GUICtrlSetState (-1, $GUI_DROPACCEPTED) GUICtrlSetTip (-1, 'You can drag & drop files here...') GuiSetState() ;Loop GUI While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd
    1 point
×
×
  • Create New...