So, I started making a text editor, but there was my first, stupid problem - how to save the text?
You know, when you enter Notepad++ (for example) you write something, save the file and close it, when you open it again the text is there - it's saved.
I wanted to make the same thing, but didn't know how... 3 Days later I still have no idea xDDD
So, I made a String, but couldn't connect it to the TextArea and then make it save itself everytime I press the "Save" button. If you wanted to make an editor, how would you solve this problem? (Yes, it's a problem for me.. lol). I just want to connect both things and make the stupid button work...
I tried with the concat method, I tried other methods but none of them worked...
P.S.:
Also, would someone check this topic : viewtopic.php?f=4&p=91258&sid=aa2330d75 ... a66#p91258
Text Editor(and my other topic)
Moderator: Coders of Rage
- YourNerdyJoe
- Chaos Rift Cool Newbie
- Posts: 79
- Joined: Sun Oct 02, 2011 3:28 pm
- Current Project: Top secret (not really) Top-Down Shooter for GBA
- Favorite Gaming Platforms: GBA, Gamecube, PC, 3DS
- Programming Language of Choice: C/C++
- Contact:
Re: Text Editor(and my other topic)
I don't know which language/api you're using but you should be doing something like this:
When save is clicked
open file for writing
get text from the text area
write the string to the file
close the file
When save is clicked
open file for writing
get text from the text area
write the string to the file
close the file
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Text Editor(and my other topic)
Somewhere Notepad++ saves a list of files you had open last time and reopens them upon loading. If you use e.g. ProcessExplorer you can get a list of open file handles and see where it's being saved to. My guess is C:\Users\<username>\AppData\Local\Notepad++\settings.ini or something like that.AronE. wrote: You know, when you enter Notepad++ (for example) you write something, save the file and close it, when you open it again the text is there - it's saved.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Text Editor(and my other topic)
Yes, but how exactly to save it after the first time it's being closed? I don't want to save it as a notepad file...YourNerdyJoe wrote:I don't know which language/api you're using but you should be doing something like this:
When save is clicked
open file for writing
get text from the text area
write the string to the file
close the file
I want to make it like this :
I open my program.
Write text.
Press Save.
Close it.
Open the program again - the text is there.
I'm using Java btw...
- YourNerdyJoe
- Chaos Rift Cool Newbie
- Posts: 79
- Joined: Sun Oct 02, 2011 3:28 pm
- Current Project: Top secret (not really) Top-Down Shooter for GBA
- Favorite Gaming Platforms: GBA, Gamecube, PC, 3DS
- Programming Language of Choice: C/C++
- Contact:
Re: Text Editor(and my other topic)
Have it write what files are open when it closes to another file. Then load that file when the program loads so it knows to open the last file you were editing automatically.