Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/21/2016 in Posts

  1. Do you need it to be on a specific line? If you're just looking to append to the end of an existing file, try FileWriteLine instead.
    1 point
  2. And you made sure the file is not empty? Look in the help file for _FileWriteToLine, it must have at least as many lines as $iLine or it will fail. Try something like this: #include <File.au3> Global $sIniFile = @ScriptDir & "\" & "Config.txt" MsgBox(1,"",$sIniFile) ;Test to see if $sIniFile is working - Comes back as expected Global $script1 = InputBox("Window Info", "Enter the name of your program identified using Auto Window Info") _FileWriteToLine($sIniFile, 1, $script1, 1) If @error Then ConsoleWrite(@error & @CRLF) Then correlate the @error number with the help file.
    1 point
  3. Tankbuster, What exactly do you want to do? Initialise an existing ListView or reload an already-intialised one dynamically with new data? By the way, you might like to Beta test this new version for me: <snip> Make sure you read the attached Guide as I have changed a fair few things - intended (I hope) to simplify the UDF for the user, such as only having the one idle loop function which looks after all the UDF events rather then a whole slew of them. And yes, it does drag/drop checkboxes! Let me know what you think, M23
    1 point
  4. Think of snowball being a small error, perhaps not even enough to crash your script. But if you don't catch it, it affects your next command. That in turn errors out, which affects the next, etc., until an error is of such a degree to halt the processing of the script altogether. Then you have to start at the error that killed your script and work your way backward to find the culprit, whereas if you catch all your errors, you will know right away when something does not process as you intended.
    1 point
  5. https://www.autoitscript.com/wiki/Best_coding_practices
    1 point
  6. georgegalily, Welcome to the AutoIt forums. I would do it this way: #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Global $aSubMenuCID[11] creategui() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case 0 ; Do nothing Case Else For $i = 1 To 10 If $aSubMenuCID[$i] = $nMsg Then MsgBox($MB_SYSTEMMODAL, "Text of the menuitem", "Text: " & GUICtrlRead($nMsg, 1)) ExitLoop EndIf Next EndSwitch WEnd Func creategui() Local $keyy GUICreate("MenuFileMAIN", 100, 100) $idFileMenu = GUICtrlCreateMenu("FILE") $idFileMenuRECENT = GUICtrlCreateMenu("RECENT_FILES", $idFileMenu) $sFilePath = @ScriptDir & "\MYFILES\SETFILES.INI" ;PATH TO SETTING FILE INI ;Local $aArray = IniReadSectionNames($sFilePath) If Not @error Then ; Enumerate through the array displaying the KEY(RECENT_FILES) names. For $i = 1 To 10 $keyy = "File " & $i ; IniRead($sFilePath, "RECENT_FILES", $i, "") $aSubMenuCID[$i] = GUICtrlCreateMenuItem($keyy, $idFileMenuRECENT) ;If IniRead($sFilePath, "RECENT_FILES", $i + 1, "") = "" Then ExitLoop Next Local $GUI_EVENT_CLOSE = GUICtrlCreateMenuItem("close", $idFileMenu) GUISetState(@SW_SHOW) EndIf EndFunc ;==>creategui You will need to reactivate the ini file lines - I changed them just for testing. Please ask if you have any questions. M23
    1 point
  7. Displaying web page often requires tens of requests. Every pic, css, script... are normally get by sending new request - unless inlined. JavaScript can be used to generate new items, yes. And it may require new requests. Sometimes the only thing in the source is link to javascript file, which then dynamically builds page on your side, like here maybe.
    1 point
  8. LoomyGnarly, Welcome to the AutoIt forums. You need to define the $i variable before you use it - like this: #include <Array.au3> $i = 3 Global $aArray[$i] _ArrayDisplay($aArray, "3 element array", Default, 8) All clear? M23
    1 point
  9. Well, you're right...you'd have to define the arrays, but not every time (unless it truly needs to be dynamic). You could declare arrays for each collection of controls at the beginning of your script. edit: Another idea I thought of to simply the array creation....you could use StringSplit to create an array from a character delimited string with your control IDs. Really cutting out the Eval overhead is what I was suggesting.
    1 point
  10. Hi @Mbee. Sorry for delay in answer. Original DBUG was designed to using with Scite4Autoit3 or other code editors based on Scite. Please try to start your script in standard Autoit3 editor with including #include <_dbug.au3>. When the main DBUG window is appear in Scite4Autoit3 window with your source code try to put break point and then press start in DBUG GUI. About upgrade ISN AutoIt Studio debugger with latest DBUG, please address this question to @ISI360 who is a developer of ISN Autoit Studio. Source code of DBUG is available.
    1 point
×
×
  • Create New...