473,503 Members | 1,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Arrh, something else is wrong! With almost identical code snipets to working code.

Arrrh! some buttons work while others don't, but I can't see why. I
have tried comparing the files that do work, with the ones that don't.
But to no help.

The funny thing is the parts that work have the same code, except
different variables.

(Note Javascript and htm code was writen by a c program, the code then
run thru a html to js converter)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Bow's and foggy's stored grahics</title>
<SCRIPT src="avatarsheader.js"></SCRIPT>
<SCRIPT src="smilesheader.js"></SCRIPT>
<SCRIPT src="sigsheader.js"></SCRIPT>
</head>
<body
background="http://home.insightbb.com/clipart/backgrounds/bkgnd019.gif"
bgcolor="#ffffff" link="#0000ff" text="#000000" vlink="#ff0000">
<h1 align="center">Bow's and foggy's stored grahics</h1>
<h2 align="center" style="color: rgb(255, 0, 0);" color="red">Team
Special Forces</h2>
<table border="1" align="center">
<tr>
<td>
<SCRIPT src="avatarsbody.js"></SCRIPT>
</tb>
<td>
<SCRIPT src="smilesbody.js"></SCRIPT>
</tb>
<td>
<SCRIPT src="sigsbody.js"></SCRIPT>
</tb>
</tr>
</tr>
<td colspan="3" align="center">
Then email it to us at <a
href="mailto:Bo*******@insightbb.com">Bo*******@in sightbb.com</a></p>
</td>
</tr>
</table>
</body>
</html>

//Generated By Easy HTML To Any Script Converter
document.writeln("<center>");
document.writeln("<h1>sigs<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"sigsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\" onclick=\"sigsprevious()\"
type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"sigsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"sigslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\"><img id=\"sigsviewer\"
src=\"sigs/motto.jpg\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"sigsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\" onclick=\"sigsprevious()\"
type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"sigsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"sigslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("sigsImages=new Array()");
document.writeln("");
document.writeln("sigsImages[0]=\"sigs/finished1.jpg\"");
document.writeln("sigsImages[1]=\"sigs/foghorn.jpg\"");
document.writeln("sigsImages[2]=\"sigs/motto.jpg\"");
document.writeln("sigsImages[3]=\"sigs/sig.jpg\"");
document.writeln("sigsImages[4]=\"sigs/SWAT.jpg\"");
document.writeln("sigsImages[5]=\"sigs/title.gif\"");
document.writeln("");
document.writeln("sigscounter=sigsImages.length-1");
document.writeln("sigsi=0");
document.writeln("");
document.writeln("function sigsfirst()");
document.writeln("{");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[0]");
document.writeln("sigsi=0");
document.writeln("}");
document.writeln("");
document.writeln("function sigsprevious()");
document.writeln("{");
document.writeln("if (sigsi>0)");
document.writeln("{");
document.writeln("sigsi++");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[sigsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function sigsnext()");
document.writeln("{");
document.writeln("if (sigsi>sigscounter)");
document.writeln("{");
document.writeln("sigsi--");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[sigsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function sigslast()");
document.writeln("{");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[sigscounter]");
document.writeln("}");
document.writeln("");
document.writeln("<\/script>");//Generated By Easy HTML To Any Script
Converter
document.writeln("<center>");
document.writeln("<h1>avatars<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"avatarsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"avatarsprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"avatarsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"avatarslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\"><img id=\"avatarsviewer\"
src=\"avatars/soscom.gif\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"avatarsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"avatarsprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"avatarsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"avatarslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("avatarsImages=new Array()");
document.writeln("");
document.writeln("avatarsImages[0]=\"avatars/160thsoar.gif\"");
document.writeln("avatarsImages[1]=\"avatars/75thrgrrgt.gif\"");
document.writeln("avatarsImages[2]=\"avatars/avatart-head_banger.gif\"");
document.writeln("avatarsImages[3]=\"avatars/soscom.gif\"");
document.writeln("avatarsImages[4]=\"avatars/syndrome.gif\"");
document.writeln("avatarsImages[5]=\"avatars/usacapoc.gif\"");
document.writeln("avatarsImages[6]=\"avatars/usajfkswcs.gif\"");
document.writeln("avatarsImages[7]=\"avatars/usasfc.gif\"");
document.writeln("avatarsImages[8]=\"avatars/usasoc.gif\"");
document.writeln("");
document.writeln("avatarscounter=avatarsImages.len gth-1");
document.writeln("avatarsi=0");
document.writeln("");
document.writeln("function avatarsfirst()");
document.writeln("{");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[0]");
document.writeln("avatarsi=0");
document.writeln("}");
document.writeln("");
document.writeln("function avatarsprevious()");
document.writeln("{");
document.writeln("if (avatarsi>0)");
document.writeln("{");
document.writeln("avatarsi--");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[avatarsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function avatarsnext()");
document.writeln("{");
document.writeln("if (avatarsi<avatarscounter)");
document.writeln("{");
document.writeln("avatarsi++");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[avatarsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function avatarslast()");
document.writeln("{");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[avatarscounter]");
document.writeln("}");
document.writeln("");
document.writeln("<\/script>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<center>");
document.writeln("<h1>smiles<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"smilesfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"smilesprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"smilesnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"smileslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\"><img id=\"smilesviewer\"
src=\"smiles/alien.gif\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"smilesfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"smilesprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"smilesnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"smileslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("smilesImages=new Array()");
document.writeln("");
document.writeln("smilesImages[0]=\"smiles/007.gif\"");
document.writeln("smilesImages[1]=\"smiles/1luvu.gif\"");
document.writeln("smilesImages[2]=\"smiles/1zhelp.gif\"");
document.writeln("smilesImages[3]=\"smiles/22_yikes.gif\"");
document.writeln("smilesImages[4]=\"smiles/2evil.gif\"");
document.writeln("smilesImages[5]=\"smiles/test.jpg\"");
document.writeln("smilesImages[6]=\"smiles/2twocents.gif\"");
document.writeln("smilesImages[7]=\"smiles/321.gif\"");
document.writeln("smilesImages[8]=\"smiles/ak47.gif\"");
document.writeln("smilesImages[9]=\"smiles/ald.gif\"");
document.writeln("smilesImages[10]=\"smiles/alien.gif\"");
document.writeln("smilesImages[11]=\"smiles/angry.gif\"");
document.writeln("smilesImages[12]=\"smiles/arsch.gif\"");
document.writeln("smilesImages[13]=\"smiles/asdf.gif\"");
document.writeln("smilesImages[14]=\"smiles/aufreg.gif\"");
document.writeln("smilesImages[15]=\"smiles/aus.gif\"");
document.writeln("smilesImages[16]=\"smiles/axt.gif\"");
document.writeln("smilesImages[17]=\"smiles/a_plain.gif\"");
document.writeln("smilesImages[18]=\"smiles/bad.gif\"");
document.writeln("smilesImages[19]=\"smiles/badassleft.gif\"");
document.writeln("smilesImages[20]=\"smiles/badassright.gif\"");
document.writeln("smilesImages[21]=\"smiles/badsmile.gif\"");
document.writeln("smilesImages[22]=\"smiles/bananasmile.gif\"");
document.writeln("smilesImages[23]=\"smiles/bananawalk.gif\"");
document.writeln("smilesImages[24]=\"smiles/batman.gif\"");
document.writeln("smilesImages[25]=\"smiles/bazooka.gif\"");
document.writeln("smilesImages[26]=\"smiles/behead.gif\"");
document.writeln("smilesImages[27]=\"smiles/bekloppt.gif\"");
document.writeln("smilesImages[28]=\"smiles/bier.gif\"");
document.writeln("smilesImages[29]=\"smiles/bigthumb.gif\"");
document.writeln("smilesImages[30]=\"smiles/bigun2.gif\"");
document.writeln("smilesImages[31]=\"smiles/birthday.gif\"");
document.writeln("smilesImages[32]=\"smiles/blaah.gif\"");
document.writeln("smilesImages[33]=\"smiles/blbl.gif\"");
document.writeln("smilesImages[34]=\"smiles/blover.gif\"");
document.writeln("smilesImages[35]=\"smiles/bong.gif\"");
document.writeln("smilesImages[36]=\"smiles/bounce.gif\"");
document.writeln("smilesImages[37]=\"smiles/bricks1.gif\"");
document.writeln("smilesImages[38]=\"smiles/bs.gif\"");
document.writeln("smilesImages[39]=\"smiles/bunny.gif\"");
document.writeln("smilesImages[40]=\"smiles/byewhore.gif\"");
document.writeln("smilesImages[41]=\"smiles/casanova.gif\"");
document.writeln("smilesImages[42]=\"smiles/charley.gif\"");
document.writeln("smilesImages[43]=\"smiles/cry.gif\"");
document.writeln("smilesImages[44]=\"smiles/cussing.gif\"");
document.writeln("smilesImages[45]=\"smiles/drink.gif\"");
document.writeln("smilesImages[46]=\"smiles/dunno.gif\"");
document.writeln("smilesImages[47]=\"smiles/eek3.gif\"");
document.writeln("smilesImages[48]=\"smiles/eek7.gif\"");
document.writeln("smilesImages[49]=\"smiles/enforcer.gif\"");
document.writeln("smilesImages[50]=\"smiles/engel.gif\"");
document.writeln("smilesImages[51]=\"smiles/freak3.gif\"");
document.writeln("smilesImages[52]=\"smiles/girl.gif\"");
document.writeln("smilesImages[53]=\"smiles/grasseater.gif\"");
document.writeln("smilesImages[54]=\"smiles/grenade.gif\"");
document.writeln("smilesImages[55]=\"smiles/hammer.gif\"");
document.writeln("smilesImages[56]=\"smiles/headshake2.gif\"");
document.writeln("smilesImages[57]=\"smiles/laser_shot_jump.gif\"");
document.writeln("smilesImages[58]=\"smiles/microwave.gif\"");
document.writeln("smilesImages[59]=\"smiles/newbie.gif\"");
document.writeln("smilesImages[60]=\"smiles/nono.gif\"");
document.writeln("smilesImages[61]=\"smiles/nuts.gif\"");
document.writeln("smilesImages[62]=\"smiles/partyman.gif\"");
document.writeln("smilesImages[63]=\"smiles/remybussi.gif\"");
document.writeln("smilesImages[64]=\"smiles/robot2.gif\"");
document.writeln("smilesImages[65]=\"smiles/samurai.gif\"");
document.writeln("smilesImages[66]=\"smiles/scratch.gif\"");
document.writeln("smilesImages[67]=\"smiles/screwy.gif\"");
document.writeln("smilesImages[68]=\"smiles/sheep.gif\"");
document.writeln("smilesImages[69]=\"smiles/shoot.gif\"");
document.writeln("smilesImages[70]=\"smiles/silly.gif\"");
document.writeln("smilesImages[71]=\"smiles/sleeping.gif\"");
document.writeln("smilesImages[72]=\"smiles/southpark.gif\"");
document.writeln("smilesImages[73]=\"smiles/spam4.gif\"");
document.writeln("smilesImages[74]=\"smiles/sword.gif\"");
document.writeln("smilesImages[75]=\"smiles/taz.gif\"");
document.writeln("smilesImages[76]=\"smiles/twak.gif\"");
document.writeln("smilesImages[77]=\"smiles/walker.gif\"");
document.writeln("smilesImages[78]=\"smiles/title.gif\"");
document.writeln("");
document.writeln("smilescounter=smilesImages.lengt h-1");
document.writeln("smilesi=0");
document.writeln("");
document.writeln("function smilesfirst()");
document.writeln("{");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[0]");
document.writeln("smilesi=0");
document.writeln("}");
document.writeln("");
document.writeln("function smilesprevious()");
document.writeln("{");
document.writeln("if (smilesi>0)");
document.writeln("{");
document.writeln("smilesi--");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[smilesi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function smilesnext()");
document.writeln("{");
document.writeln("if (smilesi<smilescounter)");
document.writeln("{");
document.writeln("smilesi++");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[smilesi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function smileslast()");
document.writeln("{");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[smilescounter]");
document.writeln("}");
document.writeln("");
document.writeln("<\/script>");

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define FALSE 0
#define TRUE 1
#define LINESIZE 255

int setupoutfiles(char filename[], FILE **header, FILE **body)
{
char tempstr[LINESIZE]="\0";

strcpy(tempstr, filename);
strcat(filename, "header.htm");
*header=fopen(filename, "w+");
if(!header) return -1;
strcat(tempstr, "body.htm");
*body=fopen(tempstr, "w+");
if(!body) return -1;
return 0;
}

int setupinfile(char filename[], FILE **infile)
{
*infile=fopen(filename, "r+");
if(!infile) return -1;
return 0;
}

void therest(FILE **header, char b[])
{
fprintf(*header, "\n%scounter=%sImages.length-1\n", b, b);
fprintf(*header, "%si=0\n\n", b);
fprintf(*header, "function %sfirst()\n", b);
fprintf(*header, "{\n");
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[0]\n", b, b);
fprintf(*header, "%si=0\n", b);
fprintf(*header, "}\n\n");

fprintf(*header, "function %sprevious()\n", b);
fprintf(*header, "{\n");
fprintf(*header, "if (%si>0)\n", b);
fprintf(*header, "{\n");
fprintf(*header, "%si--\n", b);
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[%si]\n", b, b, b);
fprintf(*header, "}\n");
fprintf(*header, "}\n\n");

fprintf(*header, "function %snext()\n", b);
fprintf(*header, "{\n");
fprintf(*header, "if (%si<%scounter)\n", b);
fprintf(*header, "{\n");
fprintf(*header, "%si++\n", b);
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[%si]\n", b, b, b);
fprintf(*header, "}\n");
fprintf(*header, "}\n\n");

fprintf(*header, "function %slast()\n", b);
fprintf(*header, "{\n");
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[%scounter]\n", b,
b, b);
fprintf(*header, "}\n\n");
fprintf(*header, "</script>");
}

int myheader(FILE **infile, FILE **header, char b[], char afile[])
{
char line[LINESIZE]="\0";
char base[LINESIZE]="\0";
int i=0;

strcpy(afile, "\0");
fprintf(*header, "<script type=\"text/javascript\">\n\n");
fprintf(*header, "%sImages=new Array()\n\n", b);
while(fgets(line, LINESIZE, *infile)!=NULL)
{
line[strlen(line)-1] = '\0';
if(strstr(line, ".gif")!=NULL || strstr(line, ".jpg")!=NULL)
{
strcpy(base, b);
strcat(base, "/");
strcat(base, line);
/*if(!rand()%1) strcpy(afile, base);*/
fprintf(*header, "%sImages[%d]=\"%s\"\n", b, i++, base);
}
}
therest(header, b);
return 0;
}

void mybuttons(FILE **body, char b[])
{
fprintf(*body, "<form>\n");
fprintf(*body, "<input value=\"First\" onclick=\"%sfirst()\"
type=\"button\">\n", b);
fprintf(*body, "<input value=\"Previous\"
onclick=\"%sprevious()\" type=\"button\">\n", b);
fprintf(*body, "<input value=\"Next\" onclick=\"%snext()\"
type=\"button\">\n", b);
fprintf(*body, "<input value=\"Last\" onclick=\"%slast()\"
type=\"button\">\n", b);
fprintf(*body, "</form>\n");
}
void mybody(FILE **body, char b[], char afile[])
{
fprintf(*body, "<center>\n");
fprintf(*body, "<h1>%s</h1>\n", b);

mybuttons(body, b);

fprintf(*body, "<table border=\"1\">\n");
fprintf(*body, "<tr>\n");
fprintf(*body, "<td align=\"center\">");
fprintf(*body, "<img id=\"%sviewer\"
src=\"%s/alien.gif\"></td>\n", b, b);
fprintf(*body, "</tr>\n");
fprintf(*body, "</table>\n");
fprintf(*body, "<p></p>\n");

mybuttons(body, b);

fprintf(*body, "<p></p>\n");
fprintf(*body, "<p>If you have a smilely</p>\n");
fprintf(*body, "</center>\n");
}

int main(int argc, char *argv[])
{
FILE *infile, *header, *body;
char outfname[LINESIZE]="\0",
tempstr[LINESIZE]="\0";

if(argc>2)
{
if(setupoutfiles(strcpy(outfname, argv[2]), &header, &body))
{
printf("problem opening outfiles %s\n", outfname);
return -1;
}
if(setupinfile(argv[1], &infile))
{
printf("problem opening infile %s\n", argv[1]);
return -1;
}
}
else
{
printf("mymenu infname [basefolder] -> basefolderheader.htm,
basefolderbody.htm\n");
return -1;
}
strcpy(outfname, argv[2]);
myheader(&infile, &header, outfname, tempstr);
mybody(&body, outfname, tempstr);

fclose(header);
fclose(body);
fclose(infile);
return 0;
}

Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Nov 14 '05 #1
9 1807
Is there some sort of limitation or something.... Because one second
something will work the next thing its not!
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Nov 14 '05 #2
j

"David. E. Goble" <de*****@gtech.computing> wrote in message
news:66********************************@4ax.com...
Is there some sort of limitation or something.... Because one second
something will work the next thing its not!


In ``therest'', line 53, you have the following,
fprintf(*header, "if (%si<%scounter)\n", b);

Which invokes undefined behaviour.
And would explain your ``sometimes works
and sometimes not'' dilemma.

--
j
Nov 14 '05 #3
David. E. Goble <de*****@gtech.computing> writes:
Arrrh! some buttons work while others don't, but I can't see why. I (Note Javascript and htm code was writen by a c program, the code then
run thru a html to js converter)

This is out of the scope here on comp.lang.c. You should redirect
your question to comp.dev.null. They probably are more familiar
with this sort of stuff.


--
/myr

Nov 14 '05 #4
In article <98********************************@4ax.com>,
David. E. Goble <de*****@gtech.computing> wrote:
Arrrh! some buttons work while others don't, but I can't see why. I
have tried comparing the files that do work, with the ones that don't.
But to no help.

The funny thing is the parts that work have the same code, except
different variables.

(Note Javascript and htm code was writen by a c program, the code then
run thru a html to js converter)


Do you have a website one can visit?

Why did you include the C code? In the web browser, you can see the
downloaded code. Look at this and see if the code was generated as you
expect. You can see the result of document.write by entering what
people around hear refer to as a one liner.

The following one-liner when pasted into the command line will
display the generated html. (It looks for line ends which are OS
dependent.):

javascript:'<html><head><title>SourceFileListing<\/title><\/head><body><c
ode><ol><li>'+(document.documentElement||document. body).innerHTML.replace
(/&/g,%22&amp;%22).replace(/</g,%22&lt;%22).replace(/%20%20/g,%22&nbsp;%2
0%22).replace(/\r\n/g,%22<li>%22).replace(/\n/g,%22<li>%22).replace(/\r/g
,%22<li>%22)+'<\/ol><\/code><\/body><\/html>';

I do not see the source to the javascript include files.

You need to narrow the problem down.

Robert
Nov 14 '05 #5
I managed to fix the problem. manually.

Yea I do, its http://home.insightbb.com/~bow.foggy Let me what you
think. Plan on adding buttons to display all smiles/avatars/sigs.

Also plan to fix the automation for maintaining the files...
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Nov 14 '05 #6
On Mon, 31 Jan 2005 19:57:11 -0600, "j" <ja**********@bellsouth.net>
wrote:

"David. E. Goble" <de*****@gtech.computing> wrote in message
news:66********************************@4ax.com.. .
Is there some sort of limitation or something.... Because one second
something will work the next thing its not!
In ``therest'', line 53, you have the following,
fprintf(*header, "if (%si<%scounter)\n", b);


Well the outputed text in all files is what was expected, namely;

if(avatarsi<avatarscounter)
if(smilesi<smilesscounter)
if(sigssi<sigscounter)

Nonetheless I did change it too;

char temp[LINESIZE];
.....

strcpy(temp, b);
strcat(temp, "i<");
fprintf(*header, "if (%s%scounter)\n", temp, b);

and also manually changed this line per run;

fprintf(*body, "<img id=\"%sviewer\" src=\"%s/alien.gif\"></td>\n", b,
b);

It seems to be working for now (Until the next time I change something
lol)

Thanks for your help. Check it out at
http://home.insightbb.com/~bow.foggy/

Which invokes undefined behaviour.
And would explain your ``sometimes works
and sometimes not'' dilemma.


Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Nov 14 '05 #7
Hi All;

Thanks for your previous help. Need ideas on how to solve a problem.

int myheader(FILE **infile, FILE **header, char b[], char afile[])
{
char line[LINESIZE]="\0";
char base[LINESIZE]="\0";
int i=0;

strcpy(afile, "\0");
fprintf(*header, "<script type=\"text/javascript\">\n\n");
fprintf(*header, "%sImages=new Array()\n\n", b);
while(fgets(line, LINESIZE, *infile)!=NULL)
{
line[strlen(line)-1] = '\0';
if(strstr(line, ".gif")!=NULL || strstr(line, ".jpg")!=NULL)
{
strcpy(base, b);
strcat(base, "/");
strcat(base, line);
/*if(!rand()%1) strcpy(afile, base);

I want to capture once and randomly one of these strings, for
later use. in the function below .

anyother way than storing all of them?

*/

fprintf(*header, "%sImages[%d]=\"%s\"\n", b, i++, base);
}
}
therest(header, b);
return 0;

void mybody(FILE **body, char b[], char afile[])
{
fprintf(*body, "<center>\n");
fprintf(*body, "<h1>%s</h1>\n", b);

mybuttons(body, b);

fprintf(*body, "<table border=\"1\">\n");
fprintf(*body, "<tr>\n");
fprintf(*body, "<td align=\"center\">");
fprintf(*body, "<img id=\"%sviewer\" src=\"%s\"></td>\n", b,
afile); /* <------------------------------------
fprintf(*body, "</tr>\n");
fprintf(*body, "</table>\n");
fprintf(*body, "<p></p>\n");

mybuttons(body, b);

fprintf(*body, "<p></p>\n");
fprintf(*body, "<p>If you have a smilely</p>\n");
fprintf(*body, "</center>\n");
}
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Nov 14 '05 #8
bd
David. E. Goble wrote:
On Mon, 31 Jan 2005 19:57:11 -0600, "j" <ja**********@bellsouth.net>
wrote:

"David. E. Goble" <de*****@gtech.computing> wrote in message
news:66********************************@4ax.com. ..
Is there some sort of limitation or something.... Because one second
something will work the next thing its not!


In ``therest'', line 53, you have the following,
fprintf(*header, "if (%si<%scounter)\n", b);


Well the outputed text in all files is what was expected, namely;

if(avatarsi<avatarscounter)
if(smilesi<smilesscounter)
if(sigssi<sigscounter)

Nonetheless I did change it too;

char temp[LINESIZE];
....

strcpy(temp, b);
strcat(temp, "i<");
fprintf(*header, "if (%s%scounter)\n", temp, b);


No need to do that. Just:
fprintf(*header, "if(%si<%scounter)\n", b, b);
Nov 14 '05 #9
On Tue, 01 Feb 2005 23:59:37 -0500, bd <bd*****@gmail.com> wrote:
David. E. Goble wrote:
On Mon, 31 Jan 2005 19:57:11 -0600, "j" <ja**********@bellsouth.net>
wrote:

"David. E. Goble" <de*****@gtech.computing> wrote in message
news:66********************************@4ax.com ...
Is there some sort of limitation or something.... Because one second
something will work the next thing its not!

In ``therest'', line 53, you have the following,
fprintf(*header, "if (%si<%scounter)\n", b,b);


Well the outputed text in all files is what was expected, namely;

if(avatarsi<avatarscounter)
if(smilesi<smilesscounter)
if(sigssi<sigscounter)

Nonetheless I did change it too;

char temp[LINESIZE];
....

strcpy(temp, b);
strcat(temp, "i<");
fprintf(*header, "if (%s%scounter)\n", temp, b);


No need to do that. Just:
fprintf(*header, "if(%si<%scounter)\n", b, b);


But, for some reason the output: if (sigsi<sigscounter)

Which is then converted to js: document.writeln("if
(sigsi<sigscounter)");

Does causes the the previous and next buttons to fail.

here is a link to the current working version;

http://home.insightbb.com/~bow.foggy/sigs/
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2208
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
44
3280
by: seberino | last post by:
Tuples are defined with regards to parentheses ()'s as everyone knows. This causes confusion for 1 item tuples since (5) can be interpreted as a tuple OR as the number 5 in a mathematical...
3
2445
by: Jeff Wilson | last post by:
I have been trying to validate my web site using the W3C validation service and have been having a hard time with Framesets. I don't know if it is me, or the validator, but I can not get any frames...
3
1358
by: Charles May | last post by:
I have a listview which checkboxes containing items to invoice. The Create Invoice button (button1) is disabled unless there are items checked. However, I had to use an if..then..else statement to...
2
1199
by: freddy | last post by:
I am using function like so: Public Class Calculation 'add function Public Function add(ByVal num1, ByVal num2) Return (num1 + num2) End Function 'subtract function Public Function...
44
4148
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a...
3
1579
by: Jules | last post by:
Just trying to display different wording depending on reference put in. Got it to work ok when it was just ABC then 123, otherwise 789, but now have to add a second IF and am getting errors. Could...
20
3890
by: John Salerno | last post by:
I'm starting out with this: try: if int(text) 0: return True else: self.error_message() return False except ValueError: self.error_message()
1
1415
by: Holly | last post by:
One of my clients called me this morning, having trouble with their blog loading. The blog does actually load, but only after such an unusually long wait it would have surely driven everyone else...
11
438
by: Tinkertim | last post by:
Hello, I've written a function similar to strdup(), except that realloc() is used and the # of characters written is returned instead of returning a cast value of memcpy(). I made this to use...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.