rowwiserepl()
By SalimMeghani
- 269 reads
void rowwiserepl(HWND hWnd, int repstrx, int repstry, int rependx, int rependy, int repfrmx, int repfrmy, int y, char *nwdll,char *dcell)
{
int gloop=0;
int dloop=0;
int crloop=0;
int alloop=0;
int nrloop=0;
int locx=0;
int locy=0;
int prvalue=0;
char cref[20];
char alpp[20];
char alfa[20];
char beta[20];
char num[20];
char source;
while (dcell[gloop]!='#')
{
while(isdigit(dcell[gloop]) || isstop(dcell[gloop]) || isoperator(dcell[gloop]) || isbracket(dcell[gloop]) || (dcell[gloop]=='E') || ( (gloop>=1) && isdigit(dcell[gloop-1]) && (dcell[gloop]=='e')))
{
nwdll[dloop]=dcell[gloop];
dloop++;
gloop++;
}
if (dcell[gloop]=='#') break;
if (isalpha(dcell[gloop]))
{
crloop=0;
do
{
cref[crloop]=dcell[gloop];
gloop++;
crloop++;
}
while (isalpha(dcell[gloop])||isdigit(dcell[gloop]));
}
cref[crloop]='\0';
nrloop=0;
crloop=0;
alloop=0;
prvalue=0;
while(isalpha(cref[crloop]) || isdigit(cref[crloop]))
{
if (isalpha(cref[crloop])) {alfa[nrloop]=cref[crloop]; nrloop++;prvalue++;}
else
if (isdigit(cref[crloop])) {alpp[alloop]=cref[crloop]; alloop++;}
crloop++;
}
alpp[alloop]='\0';
if (y<=26)
{
locx=alfa[0]-96;
current_column(alfa,beta,y);
nwdll[dloop]=alfa[0];
dloop++;
alfa[1]='\0';
}
else
if (y>26)
{
locx=y;
current_column(alfa,beta,y);
nwdll[dloop]=alfa[0];
dloop++;
nwdll[dloop]=beta[0];
dloop++;
beta[1]='\0';
}
else
{
locx=0;
errflag=1;
return;
}
clr_str(cref);
locy=atoi(alpp);
clr_str(alpp);
if ((locx<1)||(locx>100))
{
errflag=1;
return;
}
if ((locy<1)||(locy>100))
{
errflag=1;
return;
}
if (locy<=9){
nwdll[dloop]=48+locy;
dloop++;}
else if (locy <= 99) {
sprintf(alpp, "%d", locy);
nwdll[dloop] = alpp[0];
dloop++;
nwdll[dloop] = alpp[1];
dloop++;
}
else {
sprintf(alpp, "%d", locy);
nwdll[dloop] = alpp[0];
dloop++;
nwdll[dloop] = alpp[1];
dloop++;
nwdll[dloop] = alpp[2];
dloop++;
}
}
nwdll[dloop]='#';
dloop++;
nwdll[dloop]='\0';
}
/*
*/
- Log in to post comments