while(strlen) response / reply
I will post more code here, just didn't want to bog down the message board. I will get my code on screen and cut and paste the declarations below.
Thanks for the quick reply. here's more of the code:
prodtag is a global variable declared in a seperate header file as follows:
char prodtag [maxstringsize]; {maxstringsize=37,267}
The program populates another variable and then copies that to prodtag here's the fgets to the first variable
fgets(producttag, maxstringsize, producttagfileptr);
Next place prodtag is touched is in an if statement:
if (feof(producttagfileptr))
{
prodtag[0]='\0';
return(0);
}
else strcpy(prodtag, producttag);
then it hits the while loop I listed in original question. These are the only places in the program where prodtag is touched. The places where prodtag is used are just strpy using it to build other variables. but none of them change the contents of prodtag. Does this help you to help me?? Thanks very much. Have a great day!!!
Vicky
ooops, while(strlen(prodtag)) not fully functional yet
while(strlen(prodtag)==0)
{
if (strcmp(producttagtype, "IN")==0)
{
if(strcmp(producttagtaype, "ENEW")==0 || strcmp(producttagtype, "SMAG")==0 || strcmp(producttagtype, "TNEW")==0 || strcmp(producttagtype, "LTTB"))
strcpy(temppf, "<PER");
else
sprintf(temppf, "<%s", in);
while(!strstr(inputline, temppf))
subprocessfile();
}
else if (strcmp(producttagtype, "RN"==0)
veryfyfile
... {{{more else ifs here}}}
break;
}
my problem is that the break is causing the code to move on to the next function which dumps the rest of the sgm file and then adds my tags, i need to add the tags and then go to the next function while still getting out of the while loop . . .
Should I use a return; to get out of the loop and continue the program without losing the appropriate placement of the tags??
thanks.
vicky b.
While loop(strlen(prodtag)) problem... still not working right 9/24/01
I have tried many different approaches and still have had no luck getting my while loop to run properly. It runs best with the break, but I think I am puttin the break in the wrong place, because it is not outputting my variable to insert in the right place. Can anyone see what I have done to get the output backwards??
Thanks.
Vicky B. I am trying as best I can to preserve the original code as it was written, which is why I have left in the while with a strlen in it, [against advice] my charge is to fix and implement and try not to make too many modifications to original code . . . :eek:
have a great day!