Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I still can not pass aparm

Status
Not open for further replies.

wwcbill

Programmer
Jul 31, 2002
11
US
I still can not pass a parm. What am I doing wrong.
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc( billMesg) {
document.write( &quot;<tr>&quot;);
document.write( &quot;<td>&quot; + billMesg + &quot;</td>&quot;);
document.write( &quot;<tr>&quot;);
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script>
//Create an Instance of a file
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;)
// Try to open the file.
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true)
while(!myInputTextStream.AtEndOfStream){
billMesg = myInputTextStream.ReadLine();
testFunc(billMesg);
}
// Close the input
myInputTextStream.Close()
</script>
</table>
</BODY>
</HTML>
 
I have tested it. It works perfect. Are you sure you have a text file with name testmail and this file is located in the root of C:?


Regards,
Sergey Smirnov
 
I still can not get output from the above code. I have the file &quot;TESTMAIL&quot; on my &quot;C&quot; drive, in the root directory. Please help, Thank you!
 
What kind of browser do you use, by the way? This code works only in Internet Explorer and using ActiveX should be enabled.

Using your code without any correction on my side, I have an output table that has one column and each row contains one string read from file.

You can test your function using simple test. Try this one:

<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc( billMesg) {
document.write( &quot;<tr>&quot;);
document.write( &quot;<td>&quot; + billMesg + &quot;</td>&quot;);
document.write( &quot;<tr>&quot;);
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script>
// Try to use function.
testFunc(&quot;This is string 1&quot;);
testFunc(&quot;This is string 2&quot;);
testFunc(&quot;This is string 3&quot;);


</script>
</table>
</BODY>
</HTML>

This code will work in any browser. (if javascript is enabled, of course)

Regards,
Sergey Smirnov
Ask me directly at:
 
I am still trying to get the parms passed. I must be stupid but I must be missing something
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc(testData) {
document.write('<table border=0 bgcolor=#CCCCCC>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=15 width=97% bgcolor=#EEEEEE>');
document.write('<tr><td>');
document.write('<form action=&quot; method=&quot;POST&quot;>');
document.write('<input type=&quot;hidden&quot; name=&quot;type&quot; value=&quot;1&quot;>');
document.write('<input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;39241&quot;>');
document.write('<table border=0 cellpadding=0 cellspacing=0>');
document.write('<tr><td align=right>Name:</td><td><input value=&quot;William Corbett&quot; size=&quot;40&quot;> </td><tr>');
document.write('<tr><td align=right>My Mesg:</td><td><input value=></td> ');
document.write('<tr><td> + testData + size=&quot;40&quot;</td></tr>');
document.write('</table>');
document.write('</form></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script Language=&quot;JavaScript&quot;>
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true);
while(!myInputTextStream.AtEndOfStream){
testFunc(myInputTextStream.ReadLine());
}

// Close the input
myInputTextStream.Close();
</script>

</table>
</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top