Click to See Complete Forum and Search --> : Send Text to Notepad


ai3rules
09-07-2003, 01:32 PM
function arrayGenerator() {
var name = prompt("Enter name of the array")
var amount = prompt("Enter length of the array")
for (i = 0; i < amount; i++) {
document.write(name +"["+ i +"]" +" = "+ '" ' + ' "' +'<br>')
}
}

That is a simple script i wrote just so that i dont have to type the name of arrays a million times. However the problem is, is that when that script writes it out, i cannot just copy it and paste it directly from the webpage since it will paste with the <br> etc....

So, I was wondering if there was any way that i could have the script write that text directly to notepad.

Khalid Ali
09-07-2003, 02:41 PM
Answer is no.Writing to files is beyond JavaSCripts scope.

may be Some active xcontrol or an applet can do this tasj.

Mr J
09-07-2003, 05:25 PM
I tried your script and when it had wrote to the document I copied and pasted it in here as follows


Array_Name[0] = " "
Array_Name[1] = " "
Array_Name[2] = " "
Array_Name[3] = " "
Array_Name[4] = " "
Array_Name[5] = " "


There is no <br> tag

ai3rules
09-07-2003, 05:53 PM
Thanks, I didnt think so.

And, I think my problem was that i was pasting it into frontpage editor....when i pasted it into notepad I obviously had no problem.