2018-04-02 05:55:40

I will use same string in one application to create files.
If i using strings one time text from user adding normally to file and existing, after add option to display content from string program generating blank file, why? To display i used
alert("File content:","FileName: "+name+".");
What i doing wrong?

You must know... Cats are soft!

2018-04-02 09:32:20

If you're saying that you're trying to print the file contents using alert() and not seeing file contents, it looks like you're not actually printing the file contents itself.

I'm assuming name just holds the name of the file, but notice then that you're missing the contents variable (or whatever variable you're storing the contents in.)

Don't code while you're tired big_smile

Thumbs up

2018-04-02 15:48:09

I using other strings nextly to display name and content. To content is other alert with string. After add this alerts program stopping sending strings to file after press enter  to create, file generating blank

You must know... Cats are soft!

2018-04-02 17:07:48

It's hard to understand exactly what you're doing. The open method of the file object does create a blank file if you use "w" or "wb" as the mode parameter, even if you write nothing in particular.

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up

2018-04-02 20:04:56

I'm not really sure what you're trying to say, but the code in post 1 seems valid for printing a filename you've stored somewhere else in your script to the alert box.

One of the best gifts on this earth is the unconditional love of an animal

It is pure, free of judgement, and raises me to the utter height of glory.

Thumbs up