Writing a .txt file...

Blitz3D Forums/Blitz3D Beginners Area/Writing a .txt file...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

so far so good. but a problem with adding to it, it won't.. it seems like it pasting over it.. creation process is fine.

Creation function:

[WORKS]
Function WriteCode()
	code=WriteFile(WB3D_GetGadgetText(pickedfilename)+".txt")
	
    WriteLine(code,WB3D_GetGadgetText(handl)+".list = New list")
	WriteLine(code,WB3D_GetGadgetText(handl)+"\name="+Chr(34)+WB3D_GetGadgetText(name)+Chr(34))
	
	WriteLine(code,"")
	WriteLine(code,"")
	
	CloseFile(code)
End Function


and the add process...

[Broken :(]
Function AddToCode()
	
	If FileType(WB3D_GetGadgetText(pickedfile)+".txt")=1
	
	code2=OpenFile(WB3D_GetGadgetText(pickedfile)+".txt")
    WriteLine(code2,WB3D_GetGadgetText(handl)+".list = New list")
	WriteLine(code2,WB3D_GetGadgetText(handl)+"\name="+Chr(34)+WB3D_GetGadgetText(name)+Chr(34))
	
	WriteLine(code2,"")
	WriteLine(code2,"")
	
	CloseFile(code2)
	
	doesnotex=0
	
	Else
	
	doesnotex=1
	
	End If
	
End Function


somthing i'm missing? the Wb3d_GetGadgetText(handle) functions are from WinBlitz3d, it gets what a user typed in, tested that these arent the problem.. any idea?