home *** CD-ROM | disk | FTP | other *** search
- Program TestGrafReadUnit;
- {--------------------------------------------------------------}
- { This program is just a simple driver to test the GrafRead }
- { Unit. It will call the ReadString procedure while in both }
- { Text and graphics modes. It uses one of the stroked fonts }
- { while in graphics mode. }
- {--------------------------------------------------------------}
-
- Uses Crt, Graph, GrafRead; { Link the necessary units }
-
- Const
- PathToDrivers = ''; { Location of the support files }
-
- Var
- GraphDriver,
- GraphMode : Integer; { Graph Driver and Mode }
- Ch : Char; { Pausing character }
- InputString : String; { String to be inputted }
- C : Word; { Temporary calculation variable }
-
-
- Begin
- GraphDriver := Detect;
- FillChar( InputString, SizeOf( InputString ), #0 );
- { Initialize string and driver vars }
- InitGraph( GraphDriver, GraphMode, PathToDrivers );
- SetTextStyle( TriplexFont, HorizDir, 2 );
- SetBKColor( Blue ); { Use other background than black }
- GraphicsMode := True; { Indicate we are in graphics mode }
- Rectangle( 0,0,GetMaxX,GetMaxY );
- MoveTo( 5,5 ); { Frame the screen, replace pointer }
- OutText( 'Enter a String: ' );
- { Prompt user for input }
- ReadString( InputString );
- { Read the string }
- C := GetMaxY - TextHeight( 'W' ) - 5;
- OutTextXY( 5, C, InputString );
- Ch := Readkey; { Echo the string to differnt loc }
- GraphicsMode := False;
- CloseGraph; { Shut down the graphics mode }
- Writeln( 'InputString = ', InputString );
- { Echo the string in text mode }
- ReadString( InputString );{ Read the string }
- Writeln( 'InputString now = ', InputString );
- { Echo the string back to the screen}
- Readln; { Pause to view the output }
- End.