Sign in to follow this  
Followers 0
FrankwazHere

String or Alien?

2 posts in this topic

#1 ·  Posted (edited)

Issue in Short:

File write issue

Func _save()
    Local $FileName = "xml.xml"
    
    $numOfIndex = _GUICtrlListView_GetItemCount($HLISTVIEW) -1 ;5 rows
    
    FileWrite($FileName,'<?xml version="1.0"?>' & @CRLF)
    FileWrite($FileName,'<root>' & @CRLF)
    
    For $i = 0 To $numOfIndex
        $itemInRowArray = _GUICtrlListView_GetItemTextArray($HLISTVIEW, $i) ; gets the current rows array index
        FileWrite($FileName,'<offer>')
        FileWrite($FileName,'<picture>' & $itemInRowArray[5] & '</picture>' & @CRLF)
        FileWrite($FileName,'<field2>' & $itemInRowArray[1] & '</field2>' & @CRLF)
        FileWrite($FileName,'<field3>' & $itemInRowArray[2] & '</field3>' & @CRLF)
        FileWrite($FileName,'<field4>' & $itemInRowArray[4] & '</field4' & @CRLF)
        FileWrite($FileName,'<field5>' & $itemInRowArray[3] & '</field5>' & @CRLF)
        FileWrite($FileName,'<field6>' & $itemInRowArray[6] & '</field6>' & @CRLF)
        FileWrite($FileName,'<field7>' & $itemInRowArray[7] & '</field7>' & @CRLF)
        FileWrite($FileName,'</offer>' & @CRLF)
        ConsoleWrite('Wrote ' & $i & @CRLF)
        Next
            FileWrite($FileName,'</root>')
            ConsoleWrite('Data Saved')
EndFunc     ;==>_Save

FIXED, Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both!

Edited by overflo

;Frank. 

Share this post


Link to post
Share on other sites



FIXED NOW:

this was this issue! gotta love the help!

Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both!


;Frank. 

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  
Followers 0