Jump to content

TheDcoder

Active Members
  • Posts

    7,103
  • Joined

  • Days Won

    88

Everything posted by TheDcoder

  1. ​Where can I find it?
  2. Hello, I was browsing the help file (as recommend by many members) & I found out a new way to include a file I am using this: #include "...\Includes\StringSize.au3"But I get this error: Error opening the file I have already re-checked the filenames Thanks in advance, TD
    Most awesome game I ever played!
  3. How can I get input from the user when my program is compiled as a CUI? Thanks in advance, TD
  4. @Melba23 Was faster
  5. @232showtime To count no. of elements in an array, TD (-1 because UBound returns no. of elements +1
  6. I already did that @Melba23. I use ISN AutoIt Studio BTW
  7. @Melba23 Ummm... No, nothing jumps at me
  8. Hello, I am using this GUI to test drag & drops: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> Global $hGUI = GUICreate("ParentX",500,500,-1,-1,-1,-1) Global $hInput = GUICtrlCreateLabel("",0,0,507,507,-1,16) GUICtrlSetState(-1,88) GUICtrlSetBkColor(-1,"-2") GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED MsgBox(64, "Drag & Drop", '@GUI_DragFile = ' & @GUI_DragFile & @CRLF & '@GUI_DragId = ' & @GUI_DragId & @CRLF & '@GUI_DropId = ' & @GUI_DropId) EndSwitch WEndBut the MsgBox is not working Thanks in advance, TD
  9. @Melba23 No, the notification before the last notification was not clickable
  10. ​No, at normal speed
  11. @Melba23 Supplied example
  12. Error: How: Clicked all click-able notifications, happened after ~5 seconds after the last notification disappeared
  13. Thanks @Luigi & @jguinch! I adopted Melba's version of ListScripts, Thanks a lot @Melba23 for the less resource consumptive function
  14. Hello, I am using this function: Func ListScripts($sPath) Local $aFilesAU3 = _FileListToArray($sPath, "*.au3", 1, True) If @error = 4 Then Local $aFilesAU3[1] $aFilesAU3[0] = 0 EndIf Local $aFilesA3X = _FileListToArray($sPath, "*.a3x", 1, True) If @error = 4 Then Local $aFilesA3X[1] = 0 $aFilesA3X[0] = 0 EndIf If $aFilesAU3[0] = 0 And $aFilesAU3[0] = 0 Then Return Local $aReturn[UBound($aFilesAU3) + UBound($aFilesA3X) - 2] $aReturn[0] = $aFilesAU3[0] + $aFilesA3X[0] $iFileCount = $aFilesAU3[0] + $aFilesA3X[0] For $i = 1 To $aFilesAU3[0] $aReturn[$i] = $aFilesAU3[$i] Next _ArrayConcatenate($aReturn, $aFilesA3X, 1) Return $aReturn EndFuncBut It works only when the path contains both au3 & a3x files I get this error: Missing subscript dimensions in "Dim" statement. Thanks in advance, TD
  15. I need the count in my main project
  16. Whoa! What happen to the source?
  17. #include <Array.au3> #include <File.au3> Func FileBackspace($sFile, $iLine, $iCount) ; Pretty straight forward name, isn't it? $hFile = FileOpen($sFile) ; Open file in read only mode $sTempFile = _TempFile() ; Create a temp file $hTempFile = FileOpen($sTempFile) ; Open the temp file ; Copy contents of original file to temp file until the line to insert backspace is reached For $i = 1 To $iLine - 1 FileWrite($hTempFile, FileReadLine($hFile, $i) & @CRLF) Next FileWrite($hTempFile, StringTrimRight(FileReadLine($hFile, $iLine), $iCount)) ; Write the modified line ; Copy the remaining contents For $i = $iLine + 1 To _FileCountLines($sFile) FileWrite($hTempFile, FileReadLine($hFile, $i) & @CRLF) Next FileMove($sTempFile, $sFile, 1) ; Overwite the original file EndFunc Like this?
  18. Hello :), I wanna insert a backspace in a file (Sorry, I don't know what to say formally) I tried this: #include <Array.au3> Func FileBackspace($sFile, $iLine, $iCount) ; Pretty straight forward name, isn't it? $hFile = FileOpen($sFile, 2) ; Open file in over-write mode $aFile = FileReadToArray($hFile) ; File to array $aFile[$iLine] = StringTrimRight($aFile[$iLine], $iCount) ; Trim the line (NOTE: Backspace means trim starting from right) $sFile = _ArrayToString($aFile, @CRLF) ; Store new modifed file in a variable FileWrite($hFile, $hFile) ; Hmmmm... What would FileWrite do? EndFuncThis is not the best way to do this. This will be OK for small files but for files with size of 1 GB!!! I tried hard but I failed to insert backspace without storing the entire file in the RAM I want a function which does this but without storing the entire file Thanks in advance, TD
  19. Erm... Where can I find "Mark as Solved"?
  20. @Melba23 I spotted 3 4 differences. Thanks Melba! Sorry everyone, I was working non-stop & i was tired. I make silly mistakes like this when I do this
  21. Thanks @ajag, Note the [$i] TD
×
×
  • Create New...