Jump to content

Search the Community

Showing results for tags 'filewriteline'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 3 results

  1. It took a month of cutting down a big program to find it and here's the code to illustrate "Error allocating memory". The first while using the filename in the fileopen, etc. shows the error. The second while example does not have the problem (so I switched to using it). ;shows "Error allocating memory" ;Autoit v3.3.14.5 #AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK #include <FileConstants.au3> ;--- shows error allocating memory - is it Autoit or SciTE ? Try compiling <-- makes no difference so probably not SciTE. Normally error at index 50K-100K $fnINDEX = @ScriptDir & "\__index.txt" $i = 0 ;#cs While 1 $i = $i + 1 FileOpen($fnINDEX, $FO_OVERWRITE) ;overwrite as we just need last one processed FileWriteLine($fnINDEX, $i) FileClose($fnINDEX) If $i/1000 = Int($i/1000) Then MsgBox(0, "count", "$i = " & $i, 1) ;give indication of count, hangs when memory allocation error imminent WEnd ;#ce ;comment out the above loop and this works without an allocation error - looks like the above code leaking memory? While 1 $i = $i + 1 $fh = FileOpen($fnINDEX, $FO_OVERWRITE) ;overwrite as we just need last one processed FileWriteLine($fh, $i) FileClose($fh) If $i/1000 = Int($i/1000) Then MsgBox(0, "count", "$i = " & $i, 1) ;give indication of count WEnd Exit ;program
  2. Howdy! I am trying to do something a little whacky but here's the function that's kicking back an error. I am fairly sure I am overlooking a simple error but I am not seeing it. Func mouseSpot () Global $mouseSpot = MouseGetPos() ConsoleWrite ($mouseSpot[0] & ", " & $mouseSpot[1] & @CRLF) FileWriteLine ("mouseGrabs.txt" , "MouseClick ('"'primary'"' , $mouseSpot[0] , $mouseSpot[1], 1, 10)" ) EndFunc The error displays as this Any thoughts? Thanks! -Reiz
  3. I'm trying to do a few queries and have them record the results into a CSV file but I'm running into an unusual error. When I had my code write a line at the end of all the queries, I got a ton of duplicated data, so I tried to tweak when it writes to the file to eliminate redundancies. I changed the code so now it doesn't do a @CRLF until the end of the set of queries and it looks perfect on the console output, but when I open the file itself, it has all sorts of spacing. Here is the code: $sqlRs2.open ($Query2, $sqlCon) While Not $sqlRs2.EOF $Field1= $sqlRs2.Fields ('MPR').Value $Field2 = $sqlRs2.Fields ('ENT').Value $Field3 = $sqlRs2.Fields ('ROD').Value $Field4 = $sqlRs2.Fields ('ONTR').Value $Field5 = $sqlRs2.Fields ('OCAL').Value $EndDate = $sqlRs2.Fields ('End').Value $StartDate = $sqlRs2.Fields ('Start').Value ConsoleWrite($Field1 & "|" & $Field2 & "|" & $Field3 & "|" & $Field4 & "|" & $Field5 & "|" & DTFormat($StartDate) & "|" & DTFormat($EndDate) & "|") ; Write results to file FileWriteLine($fOutFile, $Field1 & "|" & $Field2 & "|" & $Field3 & "|" & $Field4 & "|" & $Field5 & "|" & DTFormat($StartDate) & "|" & DTFormat($EndDate) & "|") ; Write results to file $sqlRs6.open ($Query6, $sqlCon) While Not $sqlRs6.EOF $ID = $sqlRs6.Fields ('ERS').Value $Type = $sqlRs6.Fields ('ERS1').Value $DBRelationship = $sqlRs6.Fields ('ERT').Value DBRelationship() If $Type = 'F' Then $sqlRs7.open ($query7, $sqlCon) $Value1 = StringReplace($sqlRs7.Fields ('RIN' ).Value," ","") $Value2 = StringReplace($sqlRs7.Fields ('R70' ).Value," ","") $Value3 = StringReplace($sqlRs7.Fields ('OM' ).Value," ","") $Other = $Value & " " & $Value2 & " " & $Value3 ConsoleWrite($Other & " " & $DBRelationship & "; ") ; Write results to file FileWriteLine($fOutFile, $Other & " " & $DBRelationship & "; ") ; Write results to file $sqlRs7.close EndIf $sqlRs6.MoveNext WEnd ConsoleWrite(@CRLF) ; Write results to file FileWriteLine($fOutFile, @CRLF) $sqlRs6.close $sqlRs2.MoveNext The console out looks like this: and in the file itself, this is what I get: I tried opening it in notepad++ and I can confirm that there is a @CRLF at the end of each of the lines. Does filewriteline only create a new line? How would I get my file to look like the console output?
×
×
  • Create New...