How to open a file in TextArea (quickly)?

BlitzPlus Forums/BlitzPlus Programming/How to open a file in TextArea (quickly)?

Red(Posted 2003) [#1]
	f=ReadFile(fichier$)

	While Not Eof(f)
		ligne$=ReadLine(f) 
		AddTextAreaText MyTextArea,line$+EndLine$
	Wend 

	CloseFile f


This way takes too much time :[


Difference(Posted 2003) [#2]
Is this any help?: http://www.blitzbasic.com/codearcs/codearcs.php?code=685


Red(Posted 2003) [#3]
WOW it's strange code for me :)
but it works


Eikon(Posted 2003) [#4]
Try locking the text area and unlocking it just like a buffer for a speed boost.


JoshK(Posted 2003) [#5]
This is better:

While Not EOF(f)
    If s$<>"" s=s+Chr(10)
    s=s+ReadLine(f)
    Wend
AddTextAreaText gadget,s