It only generates an error if it is a function...
Here is the code:
Code: Select all
void Title(char* ch)
{
////////////////////////////////////////////////////////////////////////////////
////These are for thick, thin, and medium blocks////////////////////////////////
int ithin = 176; char thin = ithin;
int imed = 177; char med = imed;
int ithick = 178; char thick = ithick;
// I only knew what the block characters were as integers
// so I just converted them :)
int i = 0;//for all the loops
int offset = 0;//to centre the string
char string[81];//umm... the string...
////////////////////////////////////////////////////////////////////////////////
//Set up the string/////////////////////////////////////////////////////////////
string[0]=thin; string[1]=med; string[2]=thick;
for (int t=3; t < 77; t++)
string[t]=' ';
string[77]=thick; string[78]=med; string[79]=thin; string[80]='\0';
////////////////////////////////////////////////////////////////////////////////
for (i=0; i<80; i++)
DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
DebugPutc(thin);
for (i=0; i<78; i++)
DebugPutc(med);
DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
DebugPutc(thin); DebugPutc(med);
for (i=0; i<76; i++)
DebugPutc(thick);
DebugPutc(med); DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
offset = (74 - strlen(ch)) / 2;
DebugPutc(thin); DebugPutc(med); DebugPutc(thick);
for(i=0; i<74; i++)
DebugPutc(' ');
DebugPutc(thick); DebugPutc(med); DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
!!!THIS IS THE PART CAUSING THE PROBLEM!!!
for(int n=3; n<strlen(ch)+3; n++)
string[offset+n] = ch[n-3];
for(i=0; i<80; i++)
DebugPutc(string[i]);
////////////////////////////////////////////////////////////////////////////////
DebugPutc(thin); DebugPutc(med); DebugPutc(thick);
for(i=0; i<74; i++)
DebugPutc(' ');
DebugPutc(thick); DebugPutc(med); DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
DebugPutc(thin); DebugPutc(med);
for (i=0; i<76; i++)
DebugPutc(thick);
DebugPutc(med); DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
DebugPutc(thin);
for (i=0; i<78; i++)
DebugPutc(med);
DebugPutc(thin);
////////////////////////////////////////////////////////////////////////////////
for (i=0; i<80; i++)
DebugPutc(thin);
return;
}