ansi graphics in turbo pascal 
Author Message
 ansi graphics in turbo pascal

        Could someone explain to me how to make simple ansi graphics (like you
would find on a BBS) appear in a DOS turbo Pascal program?  How do I make
different colored text?  Please reply via e-mail

Thanks,
Joe



Wed, 18 Jun 1902 08:00:00 GMT  
 ansi graphics in turbo pascal

Quote:

>         Could someone explain to me how to make simple ansi graphics (like you
> would find on a BBS) appear in a DOS turbo pascal program?  How do I make
> different colored text?  Please reply via e-mail

You might want to download and check out:

http://pw1.netcom.com/~setech/download/fans203b.zip

You can load and display ANSI images in your TP 6/7 programs without having to
rely on ANSI.SYS being loaded.  It's a fast, complete ANSI engine (ANSI music
not supported).

Quote:
> Thanks,
> Joe


--
Scott Earnest            | SPAM protection in effect. Remove  |





Wed, 18 Jun 1902 08:00:00 GMT  
 ansi graphics in turbo pascal

 ca>         Could someone explain to me how to make simple ansi graphics (like yo
 ca> would find on a BBS) appear in a DOS turbo pascal program?  How do I m
 ca> different colored text?  Please reply via e-mail

i have routines that easiler enable me to change colors by using pipe codes
or telegard color codes:

unit tgcolor;

interface

procedure pwrite(inp:string);
procedure pwriteln(a:string);

implementation

uses crt,mav;

procedure pwrite(inp:string);
var a,
    b,
    a1,
    a2,
    blink  : byte;
    err    : integer;

begin
  a := 1;
  b := 0;
  while a <= length(inp) do
    begin
      blink := 0;
      a1 := 0;
      a2 := 0;
      case inp[a] of
        '`': if ((inp[a+1] in ['0'..'9','A'..'F']) and
                (inp[a+2] in ['0'..'9','A'..'F'])) and
                (a <= length(inp)-2) then
               begin
                 if inp[a+1] in ['0'..'9'] then
                   val(inp[a+1],a1,err)
                 else
                   a1 := ord(inp[a+1]) - 55;

                 if inp[a+2] in ['0'..'9'] then
                   val(inp[a+2],a2,err)
                 else
                   a2 := ord(inp[a+2]) - 55;

                 if a1 >= 8 then
                   begin
                     blink := 128;
                     a1 := a1 - 8;
                   end;

                 textbackground(a1);
                 textcolor(a2 + blink);
                 b := 3;
               end
             else
               begin
                 b := 1;
                 write(inp[a]);
               end;

      '|': if (inp[a+1] in ['0'..'3']) and
              (inp[a+2] in ['0'..'9']) and
              (str2int(inp[a+1] + inp[a+2]) <= 39) and
              (a <= length(inp)-2) then
             begin
               val(inp[a+1] + inp[a+2],a1,err);
               if a1 >= 24 then
                 begin
                   blink := 128;
                   a1 := a1 - 24;
                 end;

               if a1 >= 16 then
                 textbackground(a1-16);

               if a1 <= 15 then
                 textcolor(a1 + blink);
                 b := 3;
             end
           else
             begin
               b := 1;
               write(inp[a]);
             end;
      else
        begin
          b := 1;
          write(inp[a]);
        end;
      end;

      a := a + b;
    end;
end;

procedure pwriteln(a:string);
begin
  pwrite(a);
  writeln;
end;

begin
end.


... Classical music is the kind we keep thinking will turn into a tune.

~~~ Telegard/2 v3.09.b17/mL



Wed, 18 Jun 1902 08:00:00 GMT  
 ansi graphics in turbo pascal

:       Could someone explain to me how to make simple ansi graphics (like you
: would find on a BBS) appear in a DOS turbo pascal program?  How do I make
: different colored text?  Please reply via e-mail

       The ANSI editor called THEDRAW came with a
machine language (inline) Turbo Pascal "Uncrunch"
routine that will fill the whole screen with color
using a special compressed THEDRAW file format file
in a procedure.   You use THEDRAW program to create
ANSI files.
       I also wrote a comparable ANSI editor to
create ANSI files with, but it needs the DOS ANSI.SYS
loaded.

       Older versions of Turbo Pascal require a
compiler directive to use ANSI ESCAPE sequences
in a program.
       Without an ANSI editor, you need to learn
the ANSI ESCAPE sequences like Write(Chr(27),'[1;34;43m');

Ken Fischer

---



Wed, 18 Jun 1902 08:00:00 GMT  
 ansi graphics in turbo pascal

Quote:

> [...]
>        The ANSI editor called THEDRAW came with a
> machine language (inline) Turbo Pascal "Uncrunch"
> routine that will fill the whole screen with color
> using a special compressed THEDRAW file format file
> in a procedure.   You use THEDRAW program to create
> ANSI files.

Side note here.  the UNCRUNCH program doesn't acutally display ANSI files.
TheDraw lets you save in a data code format, and UNCRUNCH decodes the data.
Since it stores data as typed constants, it's a bit limited in its
functionality.

Quote:
> Ken Fischer

> ---

--
Scott Earnest            | SPAM protection in effect. Remove  |





Wed, 18 Jun 1902 08:00:00 GMT  
 ansi graphics in turbo pascal

: > [...]
: >        The ANSI editor called THEDRAW came with a
: > machine language (inline) Turbo Pascal "Uncrunch"
: > routine that will fill the whole screen with color
: > using a special compressed THEDRAW file format file
: > in a procedure.   You use THEDRAW program to create
: > ANSI files.
:
: Side note here.  the UNCRUNCH program doesn't acutally display ANSI files.

      Right, the ANSI screen must be saved in THEDRAW
as a special THEDRAW file format, which can be used as
a Turbo Pascal data cunstruct.
      But an existing ANSI screen file must already
exist and be loaded into THEDRAW, or an ANSI screen
must be created within THEDRAW.

: TheDraw lets you save in a data code format, and UNCRUNCH decodes the data.
: Since it stores data as typed constants, it's a bit limited in its
: functionality.

      Right, it's use is in programming fast display
of full color text plane screens.
      Some people like to keep programs as stand alone
without support files, that is what UNCRUNCH is for.
      To display ANSI files, intall ANSI.SYS and type
the file up in DOS, or use the SMILE or SMILEQ program
or one like them.
      In Turbo Pascal, with ANSI.SYS installed, using
the DOS write interrupt will display ANSI files, but
be aware that using ANSI.SYS exposes the keyboard keys
to possible reassignment.

Ken Fischer

---



Wed, 18 Jun 1902 08:00:00 GMT  
 ansi graphics in turbo pascal

Quote:
>      Right, it's use is in programming fast display
>of full color text plane screens.
>      Some people like to keep programs as stand alone
>without support files, that is what UNCRUNCH is for.
>      To display ANSI files, intall ANSI.SYS and type
>the file up in DOS, or use the SMILE or SMILEQ program
>or one like them.
>      In Turbo Pascal, with ANSI.SYS installed, using
>the DOS write interrupt will display ANSI files, but
>be aware that using ANSI.SYS exposes the keyboard keys
>to possible reassignment.

>Ken Fischer

If you want to use Crt and still be able to display ANSI sequences use this
at the beginning of your program:

Assign(Output, ''); { Two single quotes with nothing between }
ReWrite(Output);

Note that the file Output is NOT defined in your program. It's a built-it
text file.




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Converting Turbo Pascal to ANSI Pascal

2. Turbo Pascal vs ANSI Pascal

3. Turtle graphics for Turbo Pascal for dos

4. Displaying windows bitmaps in turbo pascal graphics

5. Turtle graphics for Turbo Pascal for dos

6. graphics in turbo pascal 7 and just TP7 !

7. Turbo PASCAL 7.0 working with graphics...

8. Turbo Pascal 7 Graphics

9. Turbo Pascal Graphic Tools

10. gwedi201.zip Graphics based Turbo Pascal string input, w/s, PD, M.Day

11. Help!--Graphics on Turbo Pascal--I'm a student

12. Turbo Pascal Graphics?

 

 
Powered by phpBB® Forum Software