Tengo la versión 3 de Builder, tengo que justificar un documento para imprimirlo, y los memo's y richedit solo tiene justificar a la izquierda y derecha. el proyecto es por equipo, ya hicimos una función que justifique pero debido a que cada caracter es de diferente tamaño nos sigue mostrando las líneas de texto sin justificar, el código de la función es el siguiente:void insert(char ss,char s[],int p){
int i,t=strlen(s)+1;
for (i=t;i>p;i--)
s[i]=s[i-1];
s[p]=ss;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char a[200], s[200];
int i,t,p,lin=0;
for(p=0;p<6; p++)
{strcpy(a,M->Lines->Strings[p].c_str());
i=0;t=0;
strcpy(s,a);
while (i<(int)strlen(a)&&t==0)
{if (a[i]==' ')
{strcpy(s,a);
insert(' ',a,i);
i++;
}
M->Lines->Delete(p);
M->Lines->Insert(p,a);
if (M->Lines->Strings[p]!=a)
{t=1;
M->Lines->Delete(p);
M->Lines->Delete(p);
M->Lines->Insert(p,s);
}
i++;
if (i==(int)strlen(a)&&t==0)
i=0;
}//fin del while
}//fin del for*/
M->Width=617;
for(lin=0;lin<6;++lin)
QR->Lines->Strings[lin]=M->Lines->Strings[lin];
}
¿QUÉ PÓDEMOS HACER?