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?

Mao!
--
TD programs website available under new address.
https://tdprograms.ovh/

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

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

Mao!
--
TD programs website available under new address.
https://tdprograms.ovh/

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.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

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.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united