Subject: OutText, integers and reals 93. ***** Q: How can I use OutText to write numbers in the graphics mode? A: OutText is the procedure to use for output in the graphics mode. The syntax of the procedure is OutText(TextString: string). You'll first have to convert a number into a string before you can output it with OutText. The example below shows how it can be done when the users wishes to output the integer value value of 12 and the result of 4/7 as a real with a suitable formatting. Generalization from thereon should be easy. uses Crt, Graph; var grDriver : integer; grMode : integer; ErrCode : integer; const CharSize : integer = 2; {} function INT2STR (x : integer; ff : byte) : string; var s : string; begin Str (x : ff, s); int2str := s; end; {} function REAL2STR (x : real; ff, dd : byte) : string; var s : string; begin Str (x : ff : dd, s); real2str := s; end; {} begin grDriver := Detect; InitGraph (grDriver, grMode, ' '); ErrCode := GraphResult; if ErrCode <> grOk then begin Writeln ('Graphics error:', GraphErrorMsg(ErrCode)); halt; end; SetColor (LightCyan); SetBkColor (Black); SetTextStyle(DefaultFont, HorizDir, CharSize); {} {... this is the example's key line ...} OutText ('The values are: ' + INT2STR(12,2) + REAL2STR(4/7,10,3)); {} MoveTo (0, 10*CharSize); OutText ('Press any key'); repeat until KeyPressed; RestoreCrtMode; CloseGraph; end. Naturally, the 12 in INT2STR(12,2) could as well be a variable containing the value. Ditto for REAL2STR(4/7,10,3). --------------------------------------------------------------------