How to regulate the text inside a border created by "\xdb"


Hello everyone;

I have created this program, its a hospital report page where a user can type the report on the run time but the problem is that when the user types the string exceeds the border set by the "\xdb". So is there any way that can move the text to new line when the text get closer to the border.

Many thanks,

THIS WAS CREATED IN TURBO C++!!

here is the code:


#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
void main()
{
clrscr();
char name[10],doctname[10],disease[10],des[200];
int age,i;
//---------------------------------------------------------------------------
for (i=0;i<=40;i++)
{
gotoxy (10+i,2);
cout <<"\xdb";
gotoxy (10+i,6);
cout <<"\xdb";
gotoxy (10+i,24);
cout <<"\xdb";
}
for (i=0;i<=22;i++)
{
gotoxy (10,2+i);
cout <<"\xdb";
gotoxy (50,2+i);
cout <<"\xdb";
}
gotoxy(11,3);
cout<<"pat Name: ";
gotoxy(11,5);
cout<<"Disease: ";
gotoxy(32,3);
cout<<"Age: ";
gotoxy(32,5);
cout<<"Doctor: ";
gotoxy(12,7);
cout<<"Patient Report: ";
gotoxy(35,22);
cout<<"Sign";
gotoxy(40,22);
cout<<"__________";
//---------------------------------------------------------------------------
gotoxy(20,3);
cin>>name;
gotoxy(20,5);
cin>>disease;
gotoxy(38,3);
cin>>age;
gotoxy(39,5);
cin>>doctname;
//----------------------------------------------------------------------------
gotoxy(11,8);
cin>>des; //heres where the user is allowed to enter the report



getch();
}
Topic archived. No new replies allowed.