Hello everybody,
I wish to parse text from a file (Used Ian M's Matrix plugins)
to my edit box (made with bluegui) but I have a little problem here. I need to add chr$(13) to proceed to the next line but I do not want that for the last line of the file.
This is the code:
repeat
// Get the data from the edit (parsed earlier?)
string$ = datafile string$ (script#)
// Parse the string to the edit
setseltext script(ID).edit, string$ `: setseltext script(ID).edit, chr$(13
// Next Line Controls :
// If the end of the file is not reached, go to the next line
if not datafile end (script#)
setseltext script(ID).edit, chr$(13)
// If the end of file is reached, remove the last (empty) line
// DOES NOT WORK: Makes a square character instead of actually adding backspace
`if datafile end(script#)
`setseltext script(ID).edit, chr$(8) // Backspace
`setseltext script(ID).edit, chr$(127) // Delete
`endif
until datafile end (script#)
My idea was to remove the last (empty) line when the datafile has reached it's end but instead of doing so, it makes a square character. The code used for that is commented out.
I do need this for my script editor else it would simply add empty lines to the file every time I save it.
Anybody got a solution? Thanks!!
Regards Sph!nx
http://www.mental-image.net