Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2509 closed Bug (Fixed)

_FileWriteToLine Bug

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.9.21 Severity: None
Keywords: Cc:

Description

;===========================
; Test of : _FileWriteToLine
; Beta version : v3.3.9.21 => ERROR
; My version : v3.3.8.1    => OK
; My config : Windows XP SP3
; date : 19th october 2013
;===========================

#include <File.au3>

Local $sFicInventaireTxt = @ScriptDir & "\" & "Beta_test_FileWriteToLine.txt"

; create file Beta_test.txt for demo (4 lines)
If Not FileExists($sFicInventaireTxt) Then
	$hFile = FileOpen($sFicInventaireTxt, 2)
	FileWrite($hFile, _
			'Line 1' & @CRLF & _
			'Line 2' & @CRLF & _
			'Line 3' & @CRLF & _
			'Line 4' & @CRLF)
	FileClose($hFile)
EndIf


; Try to add New line #
Local $nXlignes = _FileCountLines($sFicInventaireTxt)	; actual number of lines
Local $sLigneToWrite = "New line " & $nXlignes +1	; text to write to new line
Local $nNew_line = $nXlignes + 1			; new line number

_FileWriteToLine($sFicInventaireTxt, $nNew_line, $sLigneToWrite, 0) ; last param : 0=add, 1=replace

If @error Then
	MsgBox(0, "", "Error : " & @error & @CRLF & "Actual lines = " & $nXlignes & " - Try to write line " & $nNew_line)
EndIf

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by guinness

  • Resolution set to Fixed
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.