undetermined string constant error | Newbie | | Join Date: Oct 2006 Location: Florida
Posts: 3
| | |
This is a script I found elsewhere that I was hoping to tweak to do something just a little different. Can't figure out its error. I wouln't mind paying someone to help out if needed to get it to run as I'd like as well.
Thank you.
This is a test page on my site of the same script below:
http://www.personalizedletter.com/Letters/printtest.html
<HTML>
<TITLE></TITLE>
<HEAD>
<script language="JavaScript" type="text/javascript">
<!--
function createit(form) {
lrgewin = window.open("about:blank","","height=792,width=612 ,scrollbars=yes,toolbar=yes,resizable=yes,menubar= yes")
doc = lrgewin.document;
doc.open('text/html');
doc.write("<html>\n<head>\n<title>Christmas Letter Test<\/title>\n<\/head>\n<body
\"background=\"XMAS7.gif\" marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 font face=\"Lucida Sans, Arial, Veranda, Impact\" text=\"3e66ae\">\n");
doc.write("<h3 align=center></h3>It was lunch time at the North Pole. Moe and Joe Jingle, two elves from the Nintendo division, slipped outside the toy factory and quietly raced behind the reindeer barn.<br>\n<br>\n You got it? Joe asked. Moe pulled out a sheaf of papers and smiled slyly. Yep, he said. Got it. They huddled together as Moe unfolded the papers.<br>\n<br>\n So who are we reading about today? Joe asked anxiously, trying to peer over Moe's shoulder. Santa had never installed satellite TV at the North Pole, which meant entertainment was mainly limited to watching reindeer games and playing hockey. Joe and Moe were tired of both. So the two had hacked into Santa's recently computerized Naughty and Nice list to read about the lives of the faraway people who awaited the red-suited gentleman's visit every year.<br>\n<br>\n Let's see. Today we've got some folks from <!---->" + form.hometown_0.value + ", Moe said.<br>\n<br>\n Wow! They've got <!---->" + form.noun_1.value + " there! Joe said. Joe's dream was to live in <!---->" + form.hometown_2.value + ". I bet this one's gonna be good. <br>\n<br>\nMoe's eyes skimmed the paper. Sorry. Don't think so. Doesn\'t look too exciting.\"<br>\n<br>\nJoe's face fell. Well, might as well read it anyway. We don't have anything better to do. He leaned against the reindeer barn and stuck his tongue out to catch the snowflakes that had started falling.<br>\n<br>\n Let's see, Moe said. <!---->" + form.Family_members_3.value + " are their names. Sounds like they lead a pretty normal life. <!---->" + form.Child_4.value + " has a few marks in the Naughty column, but still got an overall Nice rating. <br>\n<br>\n Darn. Nice people are always so boring, Joe said. He had moved away from the building and was now leaning this way and that with his tongue out as he maneuvered to catch the falling snow.<br>\n<br>\n Well, it's not all bad. Says here that they <!---->" + form.events__5.value + ". <br>\n<br>\n Hey, that's interesting. What else? <br>\n<br>\nMoe's eyes continued down the page. They also <!----> " + form.events__6.value + " . <br>\n<br>\n What?!? Joe yelled, forgetting all about catching snow on his tongue. I\'ve always wanted to do that! <br>\n<br>\n Calm down, calm down, Moe said, motioning with his hand. <br>\n<br>\nJoe went back to his snowflake catching. I guess these people aren't as boring as I feared. He leaned his head way back to catch a snowflake and his green elf hat fall into the snow with a soft jingle from the bell on top. What else? <br>\n<br>\n <!----> " + form.events__7.value + " .\"<br>\n<br>\nJoe took a break from trying to catch snowflakes and looked at his watch. Hey, we better get something to eat before we get back to the toy factory. Anything else before we grab some grub? <br>\n<br>\nMoe skimmed the list. Well, it also says <!----> " + form.events__8.value + " . <br>\n<br>\nJoe swiped at one more snowflake with his tongue. Think you can get another file tomorrow? <br>\n<br>\n Sure. No problem. Santa will never know. He and Joe turned and headed off to the cafeteria to get lunch. <br>\n<br>\nThey never even saw the man in the red suit who was quietly adding names to his Naughty list.<br>\n<br>\n");
doc.write("\n<\/body>\n<\/html>");
doc.close();
}
//-->
</script>
<!-- #EndEditable -->
</HEAD>
<BODY>
<!-- #BeginEditable "mainbody" -->
<table border="1" width="100%" bordercolorlight="#FFFFFF" cellpadding="5" bordercolordark="#FFFFFF" id="table3">
<tr>
<td rowspan="2" style="font-family: Arial, Helvetica, sans-serif">
<p align="center">
<font color="#FF0000">
<b>
<span lang="en-us"><font size="3">Instant Christmas Story Generator</font><br>
Elves at the North Pole<br>
</span></b></font></p>
<p align="left">
<body>
To create your instant Christmas letter<font size="2"><span lang="en-us">,
simply fill in the boxes below and then click the Create button. You will then
be able to copy and print the story on your own letterhead. For best results,
you can put more than one sentence in each box. See the sample below for ideas. </span>
</font>
</BODY></p>
<hr>
<p align="center">
<font color="#FF0000">
<b>
<span lang="en-us"><br>
Elves at the North Pole</span></b></font></p>
<form name="xmasstory">
<font face="Verdana, Arial, sans-serif">It was lunch time at the North Pole. Moe and Joe Jingle, two elves from the Nintendo division, slipped outside the toy factory and quietly raced behind the reindeer barn.<br><br> You got it? Joe asked. Moe pulled out a sheaf of papers and smiled slyly. Yep, he said. Got it. They huddled together as Moe unfolded the papers.<br><br> So who are we reading about today? Joe asked anxiously, trying to peer over Moe's shoulder. Santa had never installed satellite TV at the North Pole, which meant entertainment was mainly limited to watching reindeer games and playing hockey. Joe and Moe were tired of both. So the two had hacked into Santa's recently computerized Naughty and Nice list to read about the lives of the faraway people who awaited the red-suited gentleman's visit every year.<br><br> Let's see. Today we've got some folks from <input type="text" name="hometown_0">, Moe said.<br><br> Wow! They've got <input type="text" name="noun_1"> there! Joe said. Joe's dream was to live in <input type="text" name="hometown_2">. I bet this one's gonna be good. <br><br>Moe's eyes skimmed the paper. Sorry. Don't think so. Doesn't look too exciting."<br> </font><p>Joe's face fell. Well, might as well read it anyway. We don't have anything better to do. He leaned against the reindeer barn and stuck his tongue out to catch the snowflakes that had started falling.<br> <br> Let's see, Moe said. <font face="Verdana, Arial, sans-serif"><input type="text" name="Family_members_3"></font> are their names. Sounds like they lead a pretty normal life.
<font face="Verdana, Arial, sans-serif"> <input type="text" name="Child_4"></font> has a few marks in the Naughty column, but still got an overall Nice rating. <br> <br> Darn. Nice people are always so boring, Joe said. He had moved away from the building and was now leaning this way and that with his tongue out as he maneuvered to catch the falling snow.<br> <br> Well, it's not all bad. Says here that they
<font face="Verdana, Arial, sans-serif"> <input type="text" name="events__5"></font>. <br> <br> Hey, that's interesting. What else? <br> </p>
<p>Moe's eyes continued down the page. They also
<font face="Verdana, Arial, sans-serif"> <input type="text" name="events__6"></font>. <br> <br> What?!? Joe yelled, forgetting all about catching snow on his tongue. I've always wanted to do that! <br> <br> Calm down, calm down, Moe said, motioning with his hand. <br> <br>Joe went back to his snowflake catching. I guess these people aren't as boring as I feared. He leaned his head way back to catch a snowflake and his green elf hat fall into the snow with a soft jingle from the bell on top. What else? <br> <br> <font face="Verdana, Arial, sans-serif"><input type="text" name="events__7"></font>."<br> <br> Joe took a break from trying to catch snowflakes and looked at his watch. Hey, we better get something to eat before we get back to the toy factory. Anything else before we grab some grub? <br> <br>Moe skimmed the list. Well, it also says
<font face="Verdana, Arial, sans-serif"> <input type="text" name="events__8"></font>. <br> <br>Joe swiped at one more snowflake with his tongue. Think you can get another file tomorrow? <br> <br> Sure. No problem. Santa will never know. He and Joe turned and headed off to the cafeteria to get lunch. <br> </p>
<p>They never even saw the man in the red suit who was quietly adding names to his Naughty list.<br>
</p>
<p><br>
<font face="Verdana, Arial, sans-serif">
<input type="reset" value="Clear"></font>
<font face="Verdana, Arial, sans-serif">
<input type="button" onclick="createit(document.xmasstory)" value="Create"></font>
</p>
</form></p>
</BODY>
</HTML>
| | Lives Here | | Join Date: Sep 2006
Posts: 12,070
| | | re: undetermined string constant error Quote:
Originally Posted by perlet This is a script I found elsewhere that I was hoping to tweak to do something just a little different. Can't figure out its error. I wouln't mind paying someone to help out if needed to get it to run as I'd like as well.
Thank you.
This is a test page on my site of the same script below:
http://www.personalizedletter.com/Letters/printtest.html
<HTML>
<TITLE></TITLE>
<HEAD>
<script language="JavaScript" type="text/javascript">
<!--
function createit(form) {
lrgewin = window.open("about:blank","","height=792,width=612 ,scrollbars=yes,toolbar=yes,resizable=yes,menubar= yes")
doc = lrgewin.document;
doc.open('text/html');
doc.write("<html>\n<head>\n<title>Christmas Letter Test<\/title>\n<\/head>\n<body
\"background=\"XMAS7.gif\" marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 font face=\"Lucida Sans, Arial, Veranda, Impact\" text=\"3e66ae\">\n");
doc.write("<h3 align=center></h3>It was lunch time at the North Pole. Moe and Joe Jingle, two elves from the Nintendo division, slipped outside the toy factory and quietly raced behind the reindeer barn.<br>\n<br>\n You got it? Joe asked. Moe pulled out a sheaf of papers and smiled slyly. Yep, he said. Got it. They huddled together as Moe unfolded the papers.<br>\n<br>\n So who are we reading about today? Joe asked anxiously, trying to peer over Moe's shoulder. Santa had never installed satellite TV at the North Pole, which meant entertainment was mainly limited to watching reindeer games and playing hockey. Joe and Moe were tired of both. So the two had hacked into Santa's recently computerized Naughty and Nice list to read about the lives of the faraway people who awaited the red-suited gentleman's visit every year.<br>\n<br>\n Let's see. Today we've got some folks from <!---->" + form.hometown_0.value + ", Moe said.<br>\n<br>\n Wow! They've got <!---->" + form.noun_1.value + " there! Joe said. Joe's dream was to live in <!---->" + form.hometown_2.value + ". I bet this one's gonna be good. <br>\n<br>\nMoe's eyes skimmed the paper. Sorry. Don't think so. Doesn\'t look too exciting.\"<br>\n<br>\nJoe's face fell. Well, might as well read it anyway. We don't have anything better to do. He leaned against the reindeer barn and stuck his tongue out to catch the snowflakes that had started falling.<br>\n<br>\n Let's see, Moe said. <!---->" + form.Family_members_3.value + " are their names. Sounds like they lead a pretty normal life. <!---->" + form.Child_4.value + " has a few marks in the Naughty column, but still got an overall Nice rating. <br>\n<br>\n Darn. Nice people are always so boring, Joe said. He had moved away from the building and was now leaning this way and that with his tongue out as he maneuvered to catch the falling snow.<br>\n<br>\n Well, it's not all bad. Says here that they <!---->" + form.events__5.value + ". <br>\n<br>\n Hey, that's interesting. What else? <br>\n<br>\nMoe's eyes continued down the page. They also <!----> " + form.events__6.value + " . <br>\n<br>\n What?!? Joe yelled, forgetting all about catching snow on his tongue. I\'ve always wanted to do that! <br>\n<br>\n Calm down, calm down, Moe said, motioning with his hand. <br>\n<br>\nJoe went back to his snowflake catching. I guess these people aren't as boring as I feared. He leaned his head way back to catch a snowflake and his green elf hat fall into the snow with a soft jingle from the bell on top. What else? <br>\n<br>\n <!----> " + form.events__7.value + " .\"<br>\n<br>\nJoe took a break from trying to catch snowflakes and looked at his watch. Hey, we better get something to eat before we get back to the toy factory. Anything else before we grab some grub? <br>\n<br>\nMoe skimmed the list. Well, it also says <!----> " + form.events__8.value + " . <br>\n<br>\nJoe swiped at one more snowflake with his tongue. Think you can get another file tomorrow? <br>\n<br>\n Sure. No problem. Santa will never know. He and Joe turned and headed off to the cafeteria to get lunch. <br>\n<br>\nThey never even saw the man in the red suit who was quietly adding names to his Naughty list.<br>\n<br>\n");
doc.write("\n<\/body>\n<\/html>");
doc.close();
}
//-->
</script>
<!-- #EndEditable -->
</HEAD>
<BODY>
<!-- #BeginEditable "mainbody" -->
<table border="1" width="100%" bordercolorlight="#FFFFFF" cellpadding="5" bordercolordark="#FFFFFF" id="table3">
<tr>
<td rowspan="2" style="font-family: Arial, Helvetica, sans-serif">
<p align="center">
<font color="#FF0000">
<b>
<span lang="en-us"><font size="3">Instant Christmas Story Generator</font><br>
Elves at the North Pole<br>
</span></b></font></p>
<p align="left">
<body>
To create your instant Christmas letter<font size="2"><span lang="en-us">,
simply fill in the boxes below and then click the Create button. You will then
be able to copy and print the story on your own letterhead. For best results,
you can put more than one sentence in each box. See the sample below for ideas. </span>
</font>
</BODY></p>
<hr>
<p align="center">
<font color="#FF0000">
<b>
<span lang="en-us"><br>
Elves at the North Pole</span></b></font></p>
<form name="xmasstory">
<font face="Verdana, Arial, sans-serif">It was lunch time at the North Pole. Moe and Joe Jingle, two elves from the Nintendo division, slipped outside the toy factory and quietly raced behind the reindeer barn.<br><br> You got it? Joe asked. Moe pulled out a sheaf of papers and smiled slyly. Yep, he said. Got it. They huddled together as Moe unfolded the papers.<br><br> So who are we reading about today? Joe asked anxiously, trying to peer over Moe's shoulder. Santa had never installed satellite TV at the North Pole, which meant entertainment was mainly limited to watching reindeer games and playing hockey. Joe and Moe were tired of both. So the two had hacked into Santa's recently computerized Naughty and Nice list to read about the lives of the faraway people who awaited the red-suited gentleman's visit every year.<br><br> Let's see. Today we've got some folks from <input type="text" name="hometown_0">, Moe said.<br><br> Wow! They've got <input type="text" name="noun_1"> there! Joe said. Joe's dream was to live in <input type="text" name="hometown_2">. I bet this one's gonna be good. <br><br>Moe's eyes skimmed the paper. Sorry. Don't think so. Doesn't look too exciting."<br> </font><p>Joe's face fell. Well, might as well read it anyway. We don't have anything better to do. He leaned against the reindeer barn and stuck his tongue out to catch the snowflakes that had started falling.<br> <br> Let's see, Moe said. <font face="Verdana, Arial, sans-serif"><input type="text" name="Family_members_3"></font> are their names. Sounds like they lead a pretty normal life.
<font face="Verdana, Arial, sans-serif"> <input type="text" name="Child_4"></font> has a few marks in the Naughty column, but still got an overall Nice rating. <br> <br> Darn. Nice people are always so boring, Joe said. He had moved away from the building and was now leaning this way and that with his tongue out as he maneuvered to catch the falling snow.<br> <br> Well, it's not all bad. Says here that they
<font face="Verdana, Arial, sans-serif"> <input type="text" name="events__5"></font>. <br> <br> Hey, that's interesting. What else? <br> </p>
<p>Moe's eyes continued down the page. They also
<font face="Verdana, Arial, sans-serif"> <input type="text" name="events__6"></font>. <br> <br> What?!? Joe yelled, forgetting all about catching snow on his tongue. I've always wanted to do that! <br> <br> Calm down, calm down, Moe said, motioning with his hand. <br> <br>Joe went back to his snowflake catching. I guess these people aren't as boring as I feared. He leaned his head way back to catch a snowflake and his green elf hat fall into the snow with a soft jingle from the bell on top. What else? <br> <br> <font face="Verdana, Arial, sans-serif"><input type="text" name="events__7"></font>."<br> <br> Joe took a break from trying to catch snowflakes and looked at his watch. Hey, we better get something to eat before we get back to the toy factory. Anything else before we grab some grub? <br> <br>Moe skimmed the list. Well, it also says
<font face="Verdana, Arial, sans-serif"> <input type="text" name="events__8"></font>. <br> <br>Joe swiped at one more snowflake with his tongue. Think you can get another file tomorrow? <br> <br> Sure. No problem. Santa will never know. He and Joe turned and headed off to the cafeteria to get lunch. <br> </p>
<p>They never even saw the man in the red suit who was quietly adding names to his Naughty list.<br>
</p>
<p><br>
<font face="Verdana, Arial, sans-serif">
<input type="reset" value="Clear"></font>
<font face="Verdana, Arial, sans-serif">
<input type="button" onclick="createit(document.xmasstory)" value="Create"></font>
</p>
</form></p>
</BODY>
</HTML> For someone to pay, you may need to visit www.rentacoder.com.
I edited part of your code to - doc.open('text/html');
-
doc.write("<html><head><title>Christmas Letter Test<title><head>");
-
doc.write("<body background='XMAS7.gif' marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 font face='Lucida Sans, Arial, Veranda, Impact' text='3e66ae'>");
-
doc.write("<h3 align='center'></h3>It was lunch time at the North Pole.");
-
doc.write("Moe and Joe Jingle, two elves from the Nintendo division, slipped outside the toy factory and quietly");
-
-
doc.write("raced behind the reindeer barn.<br /><br /> You got it? Joe asked.
The new error line number should now tell you what is causing the error.
| | Newbie | | Join Date: Oct 2006 Location: Florida
Posts: 3
| | | re: undetermined string constant error Quote:
Originally Posted by r035198x For someone to pay, you may need to visit www.rentacoder.com.
I edited part of your code to - doc.open('text/html');
-
doc.write("<html><head><title>Christmas Letter Test<title><head>");
-
doc.write("<body background='XMAS7.gif' marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 font face='Lucida Sans, Arial, Veranda, Impact' text='3e66ae'>");
-
doc.write("<h3 align='center'></h3>It was lunch time at the North Pole.");
-
doc.write("Moe and Joe Jingle, two elves from the Nintendo division, slipped outside the toy factory and quietly");
-
-
doc.write("raced behind the reindeer barn.<br /><br /> You got it? Joe asked.
The new error line number should now tell you what is causing the error.
Thank you very much :) I think I see some of what I did wrong. I put ( " ) rather than ( ' ). The string was also too long ... and I need break them down with a new doc.write("text here."); correct?
Please understand, I am not or have been to school or have been taught this. Up until now it has been cut and paste for me where Java is concerned.
Thank you again for the advice :) I'm off to work now.....
| | Newbie | | Join Date: Oct 2006 Location: Florida
Posts: 3
| | | re: undetermined string constant error Quote:
Originally Posted by perlet Thank you very much :) I think I see some of what I did wrong. I put ( " ) rather than ( ' ). The string was also too long ... and I need break them down with a new doc.write("text here."); correct?
Please understand, I am not or have been to school or have been taught this. Up until now it has been cut and paste for me where Java is concerned.
Thank you again for the advice :) I'm off to work now.....
It's fixed, Yeah!!!!! Now I can work on the text layouts and I'm all set to put this script to work on about 85 letters :D Thank you very much!
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,510 network members.
|