Jump to content
Sign in to follow this  
Graywalker

Code Stops working

Recommended Posts

Graywalker

; Set start time in status file
FileOpen($statusfile, $ForWriting)
$now = _Now()
FileWriteLine($statusfile, "Started Collect at : " & $now)
::::::::::::::::::::::::::::::::::::::::::
;script does stuff here
::::::::::::::::::::::::::::::::::::::::::
$hundreds = $pcc / 100
    If IsInt($hundreds) Then
        $now = _Now()
        FileWriteLine($statusfile, "   " & $pcc & " at : " & $now)
    EndIf
::::::::::::::::::::::::::::::::::::::::::
;script does stuff here
::::::::::::::::::::::::::::::::::::::::::
$now = _Now()
FileWriteLine($statusfile, "Started Re-Check at : " & $now)
$pcc = 0
::::::::::::::::::::::::::::::::::::::::::
;script does stuff here
::::::::::::::::::::::::::::::::::::::::::
$hundreds = $pcc / 100
    If IsInt($hundreds) Then
        $now = _Now()
        FileWriteLine($statusfile, "   " & $pcc & " at : " & $now)
    EndIf
::::::::::::::::::::::::::::::::::::::::::
;script does stuff here
::::::::::::::::::::::::::::::::::::::::::
$now = _Now()
FileWriteLine($statusfile, "Completed : " & $now)
FileClose($statusfile)

Okay, $pcc counts each target as it is processed. I have over 4000 targets, so it should count a LOT.

The output I get from running the script is :

Started Collect at : 4/29/2009 12:00:04 AM
   100 at : 4/29/2009 12:36:28 AM
   200 at : 4/29/2009 1:07:22 AM
   300 at : 4/29/2009 1:39:09 AM
   400 at : 4/29/2009 2:16:24 AM
   500 at : 4/29/2009 3:08:52 AM
Completed : 4/30/2009 8:33:23 AM

So it looks like 100/100 is an integer, 200, 300, 400 and 500 also. But 600/100 is not an integer?? Then it doesn't record the start of the re-check, nor any of the following 100 counts, but does write the complete.

???????

Any ideas on how to get it to count all the way and then do the re-check and count? Or why it might be skipping from 500 count all the way to complete? ( note, the LogFile shows results for each and every 4000+ computer, so I know that the script is going through the counts )

Share this post


Link to post
Share on other sites
Spiff59

Basically, all we've been given to work with are two copies of:

If IsInt($pcc / 100) Then FileWriteLine($statusfile, "   " & $pcc & " at : " & _Now())

with which I see nothing wrong. I'd suspect something is amiss in the first ";script does stuff here" section.

Edit: or the second "stuff here" section.

Edited by Spiff59

Share this post


Link to post
Share on other sites
Jos

Without really looking at your real issue I would make the test as follows:

If Not Mod($pcc,100) Then

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Graywalker

Basically, all we've been given to work with are two copies of:

If IsInt($pcc / 100) Then FileWriteLine($statusfile, "   " & $pcc & " at : " & _Now())

with which I see nothing wrong. I'd suspect something is amiss in the first ";script does stuff here" section.

Edit: or the second "stuff here" section.

Then why does it count all the way up to 500, then stop working there?

The script outputs other results to a different logfile for all 4000+.

The count is in a function, and it is the first thing done when the function runs. The function is what writes the output to the other logfile - and it is recording all 4000+ - why is the first thing in the function just stopping working at 500? The function is always called (as in it can't be skipped by an If-Then statement). The LogFile is at the end of the function and is writing for them all... so, if something was amiss with the ;does stuff then the LogFile would be skipped too, which it is not, Right??

Do
    $strDN = $objAD_Recordset.Fields(0).value
    $objPC = ObjGet($strDN)
    $strPCName = ($objPC.cn)
    $pcc = $pcc + 1
;$i = 1
;ProgressSet($i, $pcc & " of " & $RecordCount, "Working on " & $strPCName)
    Call("InfoCollect", $strPCName, $objPC, $pcc)
    $objAD_Recordset.MoveNext()
Until $objAD_Recordset.EOF()

:::::::::::::::::::::::::::::::::::::::::::::

Func InfoCollect($strPCName, $objPC, $pcc)
    
    Dim $strOS, $strOSsp, $strOSv, $strChange, $strCreate, $sTempFile, $IsAlive
;<snip of a lot of Dim statements>
    $qTunerService = 0
    $qGoverLan = 0
    $qTrendService = 0
    $sTunerService = ""
    $sTrendService = ""
    $sGoverLan = ""
    $TrendServer = "No Trend"
    
    $hundreds = 0
    $hundreds = $pcc / 100
    If IsInt($hundreds) Then
    ; Set status on each 100 with time
    ;FileOpen($statusfile, $ForAppending)
        $now = _Now()
        FileWriteLine($statusfile, "   " & $pcc & " at : " & $now)
    ;FileClose($statusfile)
    EndIf

;MsgBox(0, "PC Name", $strPCName)
    $fqdn = $objPC.distinguishedName
    $strOS = $objPC.operatingSystem
    $strOSsp = $objPC.operatingSystemServicePack
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;<snip snip>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
      ;  If blabhablhabblah then
;   Write the results to the Results file
    ;ProgressSet($i, $pcc & " of " & $RecordCount & " - Writing the Results to file", "Working on " & $strPCName)
        FileWriteLine($LogFile, $strPCName & "," & $IsAlive & "," & $strOS & "," & $strOSsp & "," & $strOSv & "," & $strChanged & "," & $strCreated & "," & $strPwdChd & "," & $strSubnet & "," & $TunerPath & "," & $sTunerServicei & "," & $sTunerService & "," & $sTrendService & "," & $TrendServer & "," & $sGoverLan & "," & $strADGROUP & "," & $Groups & "," & $drivespace)

    Else
        FileWriteLine($LogFile, $strPCName & "," & $IsAlive & "," & $strOS & "," & $strOSsp & "," & $strOSv & "," & $strChanged & "," & $strCreated & "," & $strPwdChd & "," & $strSubnet & "," & $TunerPath & "," & $sTunerServicei & "," & $sTunerService & "," & $sTrendService & "," & $TrendServer & "," & $sGoverLan & "," & $strADGROUP & "," & $Groups & "," & $drivespace)
        $recheck = $recheck & "," & $strPCName
    EndIf

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;<snip cleaning up variables by setting a lot of them to "Carryover">
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

End Func

Share this post


Link to post
Share on other sites
Graywalker

Without really looking at your real issue I would make the test as follows:

If Not Mod($pcc,100) Then
Okay, will give that a try!

Modifying code now ... starting the script and in three hours should know if it gets past 500. ^_^

Edited by Graywalker

Share this post


Link to post
Share on other sites
ajag

Without knowing your COMPLETE code, it is a guess...

Try changing

$hundreds = $pcc / 100

to

$hundreds = $pcc / 10

or

$hundreds = $pcc / 1

to see more.


Rule #1: Always do a backup         Rule #2: Always do a backup (backup of rule #1)

Share this post


Link to post
Share on other sites
Graywalker

Okay, will give that a try!

Modifying code now ... starting the script and in three hours should know if it gets past 500. ^_^

Nope. Got to 500 and stopped reporting the count and time. Kept on going with the records and results, just stopped counting. I let it get up to 875 computers processed before stopping it... so it had two chances to note 600 and 700 timestamps, it just didn't. Records and results showed up in the $logfile, but nothing happened in the $statusfile.

Without knowing your COMPLETE code, it is a guess...

Try changing

$hundreds = $pcc / 100

to

$hundreds = $pcc / 10

or

$hundreds = $pcc / 1

to see more.

Well, if I wanted to fill up my status file, maybe... I've got 4000+ to go through. Seems it would still stop at 500. But, I've set it to

If Not Mod($pcc,50) Then
        $now = _Now()
        FileWriteLine($statusfile, "   " & $pcc & " at : " & $now)
    EndIf

and testing again....

Share this post


Link to post
Share on other sites
Jos

Nope. Got to 500 and stopped reporting the count and time. Kept on going with the records and results, just stopped counting. I let it get up to 875 computers processed before stopping it... so it had two chances to note 600 and 700 timestamps, it just didn't. Records and results showed up in the $logfile, but nothing happened in the $statusfile.

Must be something else wrong in your code because that If works fine.

for $x = 1 to 10000
    If Not Mod($x,100) Then Consolewrite($x & @CRLF)
Next

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Graywalker

Must be something else wrong in your code because that If works fine.

for $x = 1 to 10000
    If Not Mod($x,100) Then Consolewrite($x & @CRLF)
Next
So, everything else in the code works perfectly, so the one thing not working has to be right and something else is wrong? I agree the loop works as you wrote it.

Also works like :

#include "Date.au3"
DIM $x = 0

Do
    $x = $x + 1
    Call("counthem",$x)
Until $x=10000

Func counthem($x)
        $now = _Now()
        If Not Mod($x,100) Then Consolewrite($x & " " & $now & @CRLF)
EndFunc

I can't see what would be stopping it at 500 in my script. Its not like it doesn't get there... the section is run...

Okay, so the whole code is attached along with the status file. The Results file would be huge and contains company computer data, which I can't send out, of course. Anyone interested will just have to trust me that it lists all the info for all 4155 computers, then goes back and hits another 1005 that didn't respond the first time. So, the script is working - all except the count, which quits at 500. (or between 500 and 550)

Any ideas? The whole script is attached with only minor alteration (changing company name, etc)

status05012009.txt

AssetCollect.au3

Share this post


Link to post
Share on other sites
Jos

So, everything else in the code works perfectly, so the one thing not working has to be right and something else is wrong? I agree the loop works as you wrote it.

What can I say: I always try to go on what I have and know ... but no offense intended. ^_^

So, everything else in the code works perfectly, so the one thing not working has to be right and something else is wrong? I agree the loop works as you wrote it.

I can't see what would be stopping it at 500 in my script. Its not like it doesn't get there... the section is run...

Okay, so the whole code is attached along with the status file. The Results file would be huge and contains company computer data, which I can't send out, of course. Anyone interested will just have to trust me that it lists all the info for all 4155 computers, then goes back and hits another 1005 that didn't respond the first time. So, the script is working - all except the count, which quits at 500. (or between 500 and 550)

Any ideas? The whole script is attached with only minor alteration (changing company name, etc)

Can't really test much with your code because of the AD stuff, but one thing I see that is kinda wrong is that you open the file but are not using its returned filehandle:

; Set start time in status file
FileOpen($statusfile, $ForWriting)
$now = _Now()
FileWriteLine($statusfile, "Started Collect at : " & $now)
;FileClose($statusfile)

Should read:

; Set start time in status file
$h_Status = FileOpen($statusfile, $ForWriting)
$now = _Now()
FileWriteLine($h_Status, "Started Collect at : " & $now)
;FileClose($h_Status)

I see that you did comment that later in your InfoCollect() func and are there also using the filename in stead of the handle.

What happens with a FileWriteLine() using a filename in stead of a handle is that the File is Opened, Record written and file closed again.

Not sure if this could give issues writing to the file and when testing without the AD part things work fine:

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\..\My Pictures\universe.ico
#AutoIt3Wrapper_Outfile=AssetCollect.exe
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include "String.au3"
;~ #include "ADFunctions.au3"
#include "ServiceControl.au3"
#include "array.au3"
#include "Date.au3"

;----- Customize the following constants for your needs -----
Const $statusfile = "status" & @MON & @MDAY & @YEAR & ".txt"
Const $ResultsFile = "AssetCollect" & @MON & @MDAY & @YEAR & ".csv"
Const $ScriptVersion = 1.0
Global $g_eventerror = 0; to be checked to know if com error occurs. Must be reset after handling.
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc"); Install a custom error handler
Global $psservice = @ComSpec & ' /c "' & @ScriptDir & '\psservice.exe"'
Global $recheck = ""

;------ Constant Declarantions ----------
Const $ForReading = 0
Const $ForWriting = 2
Const $ForAppending = 1
Const $LDAP_Suffix = "DC=yourcompany,DC=local"
Const $adOpenStatic = 3
Const $adLockOptimistic = 3
Const $adCmdText = "&H0001"
Const $ADS_SCOPE_SUBTREE = 2

;    Constants for the NameTranslate function.
Const $ADS_NAME_INITTYPE_GC = 3
Const $ADS_NAME_TYPE_NT4 = 3
Const $ADS_NAME_TYPE_1779 = 1

; Dim the Variables used
Dim $LogFile, $objAD_Recordset, $strDN, $strPCName, $objPC, $RecordCount, $pcc, $objAD_Command, $a_PCNames
Dim $i = 0
Dim $ErrorFile, $timenow, $start

; Initalize;Progress bar
;ProgressOn("Asset Collect Working...", "Checking Computers", "Please wait...", 2, -2, 18)

; Establish Log File to write results to
$LogFile = FileOpen($ResultsFile, $ForWriting)
If @error = -1 Then
    MsgBox(0, "Error", "ERROR: Unable to initialize requested log file, " & $ResultsFile & ".")
    FileClose($ResultsFile)
    Exit
EndIf;Err.Number <> 0

$ErrorFile = FileOpen("ErrorFile" & @MON & @MDAY & @YEAR & ".csv", $ForWriting)
If @error = -1 Then
    MsgBox(0, "Error", "ERROR: Unable to initialize requested Error log file.")
    FileClose($ErrorFile)
    Exit
EndIf

; Set start time in status file
$now = _Now()
FileWriteLine($statusfile, "Started Collect at : " & $now)

Do
    $pcc = $pcc + 1
    InfoCollect($strPCName, $objPC, $pcc)
Until $pcc = 1500

$now = _Now()
FileWriteLine($statusfile, "Completed : " & $now)

Exit

; ********* Functions that do the actual working **********

Func InfoCollect($strPCName, $objPC, $pcc)
    Dim $strOS, $strOSsp, $strOSv, $strChange, $strCreate, $sTempFile, $IsAlive
    Dim $stripIP, $arrIP, $strSubnet, $pingresult, $sStart, $sEnd, $sString, $strADGROUP
    Dim $cDay, $cHour, $cMin, $cMonth, $cYear, $crDay, $crYear, $crHour, $crMin, $crMonth, $netwrkAddr
    Dim $strGroup, $Group, $Groups, $s, $sTrendService, $qTrendService, $qTunerService, $sTunerService, $lastlogon
    Dim $arrGroups[1000], $fqdn, $memberof, $strTunerPathC, $strTunerPathD, $strTunerPathE, $TunerPath, $strPwdCh, $strPwdChd
    Dim $IPSubkey, $IPkey, $keyread = "No", $r = 0, $drivespace, $Locator, $Service, $TrendServer, $hundreds
    Dim $ABCDService, $ABCSAService, $ABCRpService, $ABCLaptop, $ApplicationPkgr, $EndNode, $TheCityMain, $Test
    Dim $ABCDay, $ABCMirror, $ABCATM, $sTunerServicei, $WMITest, $psscmd, $pss_check, $sGoverLan, $qGoverLan, $ABC_Server
    Dim $services = "\HKLM\SYSTEM\CurrentControlSet\Services"
    Global $trendkey = "\\" & $strPCName & "\HKLM\SOFTWARE\TrendMicro"
    $qTunerService = 0
    $qGoverLan = 0
    $qTrendService = 0
    $sTunerService = ""
    $sTrendService = ""
    $sGoverLan = ""
    $TrendServer = "No Trend"
    
    If Not Mod($pcc,50) Then
        $now = _Now()
        FileWriteLine($statusfile, "   " & $pcc & " at : " & $now)
    EndIf

EndFunc;==>InfoCollect

This code has some changes in it like not using the Call() statement and removing the Fileopen() and Fileclose() which are not correctly used.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

Just one other thought: Couldn't you just, each time you perform the InfoCollect() func, write the value of $pcc to a file for debugging?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Spiff59

I also don't have Active Directory available, but at a glance nothing really jumps out at me.

It seems to me the IsObj() test in line 199 is out of place. Anything that might fail that test would have already blown up in lines 185-191.

Have you tried commenting out the InfoCollect para and just seen if you can get through the recordset without error?

Maybe there is something unexpected in there, a bad object or something unable to return the .cn field?

If your DO/Until were changed to this, for a test, it ought to run in a minute or two, and at least see if you're making it through the recordset...

Do
    $pcc = $pcc + 1
    Tooltip("PCC = " & $pcc, 200, 200)
    $strDN = $objAD_Recordset.Fields(0).value
    $objPC = ObjGet($strDN)
    If Not IsObj($objPC) Then
        MsgBox(1, "", "Object error at : " & $pcc)
        Exit
    EndIf
    $strPCName = ($objPC.cn)
;$i = 1
;ProgressSet($i, $pcc & " of " & $RecordCount, "Working on " & $strPCName)
;   Call("InfoCollect", $strPCName, $objPC, $pcc)
    $objAD_Recordset.MoveNext()
Until $objAD_Recordset.EOF()

Edit: Here's the freakish/fishy part. How can your test runs output the "Completed :" line to the statusfile without having output the "Completed & Started Re-Check at :" line?

Edited by Spiff59

Share this post


Link to post
Share on other sites
Graywalker

What can I say: I always try to go on what I have and know ... but no offense intended. ^_^

No offense - taken or meant - just fried my logic circuit for a moment. ;)

Can't really test much with your code because of the AD stuff, but one thing I see that is kinda wrong is that you open the file but are not using its returned filehandle:

I see that you did comment that later in your InfoCollect() func and are there also using the filename in stead of the handle.

What happens with a FileWriteLine() using a filename in stead of a handle is that the File is Opened, Record written and file closed again.

Not sure if this could give issues writing to the file and when testing without the AD part things work fine:

This code has some changes in it like not using the Call() statement and removing the Fileopen() and Fileclose() which are not correctly used.

Jos

The file handle thing is probably it. Just right out there in the open, so easy to see it evaded me completely. Thank you! I meant to use a file handle... :(

Couldn't see the Tree for the Forest kinda thing.

The FileOpen() and FileClose() were there when I was opening and closing the statusfile each time... commented them out mostly. Changed code to use the file handle. (Doah!) Made the Statusfile behave just like the results file, so it should work. Testing now and will confirm.

Again, thank you very much.

Share this post


Link to post
Share on other sites
Graywalker

I also don't have Active Directory available, but at a glance nothing really jumps out at me.

It seems to me the IsObj() test in line 199 is out of place. Anything that might fail that test would have already blown up in lines 185-191.

Have you tried commenting out the InfoCollect para and just seen if you can get through the recordset without error?

Maybe there is something unexpected in there, a bad object or something unable to return the .cn field?

If your DO/Until were changed to this, for a test, it ought to run in a minute or two, and at least see if you're making it through the recordset...

Edit: Here's the freakish/fishy part. How can your test runs output the "Completed :" line to the statusfile without having output the "Completed & Started Re-Check at :" line?

Line 199 IsObj() - ... er... redundancy? ... I like code snippits. LOL. ^_^

The $resultsfile has all of the records, so nothing is erroring out... it completes with all info needed. Just the $statusfile stops at 500... then picks back up to "Complete."

The only thing I see is that before the $statusfile was opened for the "complete" is that the two other files were closed.

FileClose($LogFile)
FileClose($ErrorFile)
;ProgressOff()

Call("ResultsCleanup")

; Set complete time for full run
;FileOpen($statusfile, $ForAppending)
$now = _Now()
FileWriteLine($statusfile, "Completed : " & $now)
FileClose($statusfile)

So, was I running out of some "Open File" counter and closing those two created room to open the $statusfile again? I wasn't using a file handle.... I gather that it was supposed to open-write-close, but was it filling up some kind of fileopen que and I just ran it out of room opening so many times?

Also noticed on the Help file for "FileWriteLine" - "Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Either use filehandles or filenames in your routines, not both."

Which is exactly what I did... I think.... I FileOpened it and then used the filename.... so maybe what was happening was the result of disregarding the note. ;)

; Set start time in status file
FileOpen($statusfile, $ForWriting)
$now = _Now()
FileWriteLine($statusfile, "Started Collect at : " & $now)
::::::::::::::::::::::::::::::::::::::::::
;script does stuff here
::::::::::::::::::::::::::::::::::::::::::

Yep... BAD THING.

Should be:

; Set start time in status file
$status = FileOpen($statusfile, $ForWriting)
$now = _Now()
FileWriteLine($status, "Started Collect at : " & $now)
::::::::::::::::::::::::::::::::::::::::::
;script does stuff here
::::::::::::::::::::::::::::::::::::::::::

Going with FileHandles.... says that is the faster way.

Edited by Graywalker

Share this post


Link to post
Share on other sites
Jos

You will run out of filehandles when you do:

FileOpen($statusfile, $ForWriting)
FileClose($statusfile)

Simply because the close fails as that requires a Handle, not the filename.

That is why I said I wasn't sure if your posted version of the script should have that issue as you are not using many FileOpen's like you did in this code portion in the InfoCollect() Func:

FileOpen($statusfile, $ForAppending)
        $now = _Now()
        FileWriteLine($statusfile, "   " & $pcc & " at : " & $now)
        FileClose($statusfile)

That would run fast out of filehandles..

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Graywalker

Okay, here is the situation. The above script runs on a Utility Server on a Schedule, so I can't use a progress bar to keep track of where its at like I use when I run a similar script on my workstation. The script runs for like two days. I need to be able to see how far the script has progressed by opening a file and seeing what it has done already and when.

I've tried tons of different ways and nothing really works.

So far, only $status = FileOpen($statusfile, $ForWriting) and keeping it open till the end kind of works past 500. Which is to say that it doesn't update the file periodically, but keeps it all in a que or something then writes to it after the script finishes, showing all timestamps. Which is useless because I need to be able to tell where the script is by looking at the file and tell if it is around 300 or 3000 so I can guess when it may finish or tell if its hung up, etc.

So, is there a way to flush the filehandles taken up so it will re-use? Is there another way to leave a file documentation of the script's progress that can be checked periodically to see where the script is and how its working? Basically, I need to update a file like a progress bar - not something I can check only when its finished.

Share this post


Link to post
Share on other sites
Jos

Okay, here is the situation. The above script runs on a Utility Server on a Schedule, so I can't use a progress bar to keep track of where its at like I use when I run a similar script on my workstation. The script runs for like two days. I need to be able to see how far the script has progressed by opening a file and seeing what it has done already and when.

I've tried tons of different ways and nothing really works.

So far, only $status = FileOpen($statusfile, $ForWriting) and keeping it open till the end kind of works past 500. Which is to say that it doesn't update the file periodically, but keeps it all in a que or something then writes to it after the script finishes, showing all timestamps. Which is useless because I need to be able to tell where the script is by looking at the file and tell if it is around 300 or 3000 so I can guess when it may finish or tell if its hung up, etc.

So, is there a way to flush the filehandles taken up so it will re-use? Is there another way to leave a file documentation of the script's progress that can be checked periodically to see where the script is and how its working? Basically, I need to update a file like a progress bar - not something I can check only when its finished.

You really want to do the FileWriteLine($Filename,"text") since this will do exactly what you want.

I don't think you need to worry about the performance site of it as you aren't really writing many lines and the only way to flush the file is to close it. (which is implicit the the FileWriteLine() when you use a filename.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.