#include <File.au3> #include <FileConstants.au3> Local $sTestfile = "_FileWriteToLine.txt" Local $hTestfile = FileOpen($sTestfile, $FO_APPEND) FileWriteLine($hTestfile, "Line 1") FileWriteLine($hTestfile, "Line 2") FileWriteLine($hTestfile, "Line 3") FileClose($hTestfile) _FileWriteToLine("_FileWriteToLine.txt", 2, "Overwritten", True) The above example code first creates a text file that has four lines after FileClose:
Line 1 Line 2 Line 3 And an empty line. After _FileWriteToLine only three lines are left:
Line 1 Overwritten Line 3 The empty line has been removed by the function _FileWriteToLine!
I have a text file which has over 1000 lines, and I wish to replace one particular - I was able to do the replacement - but I have a issue - I want the numbers to be of specific format
Eg; my command was as follows,
my command >>>>> _filewritetoline($inp_file,$inp_replacement,"WAVE1.00STOK"&$hdet&" "&$tasso&" "&"270.0 D 5.0 72MS 1",true)
my output >>>>>> WAVE1.00STOK10.06 9.800 270.0 D 5.0 72MS 1
how do I make sure that the $hdet=10.06 is printed as 10.060(3 digits after decimel) and same with $tasso and so on.. also, how to maintain the required gap between the variables - is it by manually putting spaces ?
WinSetState ("[CLASS:OpusApp]", "", @SW_SHOWMAXIMIZED) and WinSetState ("[CLASS:OpusApp]", "", @SW_MAXIMIZE) don't maximize the window. Using WinSetState("[CLASS:OpusApp]","",@SW_RESTORE) allows me to maximize it about 15% of the time. I've tried using WinMove("[active]",0,0,@Desktopwidth,@Desktopheight), but that only makes it worse. I've also tried putting in a sleep and maximizing it again. Does anyone have a solution?
Here's my code:
The startup script is intentionally commented, because I'm not testing it right now. The other comment is just for debugging when I need it.
UPDATE: When I run two instances of the program, it works almost all the time, but if I copy the code inside the else statement twice it doesn't work at all (despite the fact that it's running the same code just in one program vs two). I also noticed that when I run two instances of it, about 50% of the time when it opens both the windows, it also hits the windows button and types the letter d into the search box. Neither of these actions are in my code. I'm not really sure what's going on.
_ArrayDisplay($aArray, "Window Title", "1:", 0, Default, "Column") ; Expected results are rows 1 to the end of the array, all columns. The result is rows 0-1, all columns. The API reference is here:
Am I doing something wrong?
I just playing around with _ArrayMin for my next project, but seems like it's not working. I think the code is OK, but I always get the value of $aArray, not col 2's lowest value (see attached image)