Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/16/2024 in all areas

  1. RTFC

    Two Questions

    Good day to you too. My day was crap, thank you for asking. A1: first read this. So given you're running in a 64-bit environment, call _WinAPI_Wow64EnableWow64FsRedirection with parameter True if you wish to use the legacy 32-bit Windwos system dll's, and False (or don't call it) if you know you can use the newer 64-bit versions that are native to x64 Windows. Basically if you use legacy code yourself that relies on the old 32-bit Windows dll's, you'd want to set this, otherwise leave it be. A2: the #include keyword followed by a filename (in quotation marks, or between angled brackets if it's a native AutoIt #include) does exactly that (assuming that the file is found, that is): it takes the contents of that file and inserts these as one giant copy-paste into the master script that will be compiled/executed. most include's are function libraries whose functions can thereafter be called by other parts of your code, but you could use it to insert the complete works of Shakespeare if you like (but as a (rather large) comment section, otherwise the compiler will complain, because it hates Shakespeare (as it doesn't really understand it)). Note that the included text (whatever it is) is inserted at the exact point where the #include statement was in your original script, which can be important (if you're #including raw lines of code, for example). So don't place an #include in the middle of another function, unless you know what you're doing. You can run Au3Stripper (either at the cmdline or from (full) Scite4AutoIt) to produce the single script with all required parts of the #includes added (and the #include statements removed). Compare and contrast with the original source for hours of fun.
    1 point
  2. TheXman

    Search and Delete

    Your reply tells me that you most likely did not write the code in the original post. If you had, then you would have known that it only required small changes to get it work with _FileListToArrayRec(). Below is an example of how it can be done: #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> #include <File.au3> #include <Debug.au3> _DebugSetup("File Delete Example", False, 5) example() Func example() Local $aFiles[0] ;Get list of files $aFiles = _FileListToArrayRec("C:\tmp", "*|*.sav", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) If @error Then Exit MsgBox($MB_ICONERROR, "ERROR", "_FileListToArrayRec() failed with @error = " & @error) ;Process files For $i = 1 To $aFiles[0] If FileDelete($aFiles[$i]) Then _DebugOut(StringFormat('"%s" deleted.' , $aFiles[$i])) Else _DebugOut(StringFormat('Unable to delete "%s".', $aFiles[$i])) EndIf Next EndFunc Since you are obviously new to scripting, I would suggest that you be very careful when testing & running scripts that delete files.
    1 point
  3. GaryFrost

    Updown Control

    Think this is what your trying to do #include "GUIConstants.au3" $title = "My GUI UpDown" GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX) $input = GUICtrlCreateInput ("2",10,10, 50, 20, $ES_NUMBER) $updown = GUICtrlCreateUpdown($input) GUICtrlSetLimit($updown,100,0) $old = 2 ; Attempt to resize input control GUICtrlSetPos($input, 10,10, 100, 40 ) GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $old <> Int(GUICtrlRead($input)) Then If $old < Int(GUICtrlRead($input)) Then; up $old = ((Int(GUICtrlRead($input)) - $old) * 5) + $old If $old > 100 Then $old = 100 GUICtrlSetData($input,$old) Else $old = (($old - Int(GUICtrlRead($input))) * -5) + $old If $old < 0 Then $old = 0 GUICtrlSetData($input,$old) EndIf EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend msgbox(0,"Updown",GUICtrlRead($input))
    1 point
×
×
  • Create New...