Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!ukma!psuvm.bitnet!e8d From: E8D@PSUVM.BITNET Newsgroups: comp.lang.pascal Subject: Turbo 4.0 graphics problem Message-ID: <40184E8D@PSUVM> Date: 23 Apr 88 19:16:05 GMT Organization: The Pennsylvania State University - Computation Center Lines: 68 I seem to have run into a bug using the procedures OutText and OutTextXY in Turbo 4.0 graphics mode. They reset the CP to the upper left corner of the character box. OutText should only move CP if the horizontal justification is Left and OutTextXY shouldn't ever change the Current Position. Does anyone know of a fix for this (aside from storing and retrieving CP)? Here's a little routine which shows the problem: Program graphbug;{.PAS} {program to demonstrate how OutText and OutTextXY change the cp in graphics mode when they should not.} uses Graph, CRT; var graphDriver,GraphMode: integer; symbol,ch: char; Procedure OpenGraph; begin GraphDriver := Detect; initgraph(GraphDriver,Graphmode, ''); {Put in your driverpath} end;{OpenGraph} Procedure Plot; var Xpix, Ypix: integer; begin xpix := 400; ypix := 150; SetTextStyle(Defaultfont,HorizDir,4); {enlarge the symbol} SetTextJustify(CenterText,CenterText); Symbol := '0'; MoveTo(xpix,ypix); OutTextXY(xpix,ypix,symbol); {should not change cp} xpix := xpix - 100; lineto(xpix,ypix); Symbol := '1'; OutText(symbol); {should not change cp if text is centered} xpix := xpix + 100; ypix := ypix - 100; lineto(xpix,ypix); Symbol := '2'; OutText(symbol); xpix := xpix + 100; lineto(xpix,ypix); Symbol := 'X'; Outtext(symbol); MoveTo(xpix,ypix); {fix to reset cp to proper position} xpix := 400; ypix := 150; lineto(xpix,ypix); MoveTo(0,0); SetTextStyle(Defaultfont,HorizDir,1); {default text size} SetTextJustify(LeftText,TopText); OutText('Press any key'); end;{Plot} begin {main} Opengraph; Plot; ch :=readkey; {Pause} closegraph; end.{main} ------------------ Evan Dresel E8D at psuvm.bitnet Dept. of Geochemistry Penn State University University Park PA 16802 "He is a man of splendid abilities but utterly corrupt. He shines and stinks like a rotten mackerel by moonlight."