Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 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 by guinness, 12 years ago

Resolution: Fixed
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.