Yes, I made it! Text editor which supports saving files, with no limits of files saved!
UPDATE: YES! It deletes files now!
It uses two lists to store information; one is for text itself, and another one stores filenames and helps to locate the file in the first list. It's like this:
+-------------+------------------------------------------+ | File1 | Contents of file 1 | +-------------+------------------------------------------+ | File1 | Contents of file 1 continued | +-------------+------------------------------------------+ | File2 | Contents of file 2 | +-------------+------------------------------------------+ | File2 | Contents of file 2 continued | +-------------+------------------------------------------+
So, I worked on it about 30 mins to get everything working (saving, loading, allocation and editing functions). The long time took to figure out how to delete files (Made with reversed loop.) There's an advanced mechanism for editing. If you want to change a line, type this:
@[line number:number]%[new text:text]
So, if you'd want to change line 10 to "LOL", type this:
@10%LOL
This will take a while to process (because it needs to separate line number and text, that's the % character for. If you want to insert new line at a position, type this:
*[line number:number]%[new text:text]
So, inserting "The new line" at line 14 and moving all further lines below, type this:
*14%The new line
Deleting a line is simpler - just type:
^[line number:number]
So, to delete something at line 20, you'll type this:
^20
This version doesn't support deleting and overwriting files, but I'll work on it, if this project gets at least 2 love-its.
It doesn't save files permanently online. To save a file permanently, you have to download project, save a file and then save the project. If you do so, try closing Scratch, opening it again, opening this project and loading your previously saved file.
You can load intro file for more: Click green flag, then type in:
load (enter) intro (enter) no (enter)
Here it is:
Text editor with saving
Last edited by filo5 (2009-08-16 06:51:57)
Offline