Category : Printer + Display Graphics
Archive   : SPIN.ZIP
Filename : COLORS.PAS

 
Output of file : COLORS.PAS contained in archive : SPIN.ZIP
Program Colors;

(* This program generates an AcroSpin file called COLORS.FIL that displays *)
(* 15 colors inside squares. I wrote this program using Turbo Pascal version *)
(* 3.0. *)
(* David B. Parker *)

(* Variables. *)

Var I, J, K, L : Integer; (* Looping variables. *)
ColorNumber: Integer; (* Current color. *)
ColorString: String[2]; (* String representation of current color. *)
Output : Text; (* Output file. *)

(* Include the subroutine that writes out text. *)

{$I WRITETEX.PAS}

(* Open the input file. *)

Begin
Assign(Output,'COLORS.FIL');
Rewrite(Output);

(* Draw fifteen squares, each a different color, in three rows of five *)
(* squares each. *)

For I := 1 To 3 Do
For J := 1 To 5 Do

(* Write the color number in the center of the current square. *)

Begin
ColorNumber := 5*(I-1)+J;
Str(ColorNumber,ColorString);
WriteText(ColorNumber,
1000.0*0.8,1000.0*0.8,

0.0,0.0,0.0,
1000.0*(3.0*J-2.0-Length(ColorString)*4.5/13.0),
-1000.0*(3.0*I-2.0+0.4),0.0,
ColorString);

(* Write out the end points for the current square. The name for each point *)
(* is the prefix S, followed by the color number of the current square, *)
(* followed by P, followed by a number from 0 to 3. *)

For K := 0 To 1 Do
For L := 0 To 1 Do
Writeln(Output,'EndPoint',
' X ',Round(1000.0*(3.0*(J-1)+2*K)),
' Y ',Round(-1000.0*(3.0*(I-1)+2*L)),
' Z 0',
' Name S',ColorNumber,'P',2*K+L);

(* Write out the four lines for the current square. *)

For K := 0 To 2 Do
For L := 0 To 1 Do
If (K And (1 Shl L)) = 0 Then
Writeln(Output,'Line From S',ColorNumber,'P',K,' To S',
ColorNumber,'P',K+(1 Shl L),
' Color ',ColorNumber);
End;

(* Close the output file. *)

Close(Output);
End.


  3 Responses to “Category : Printer + Display Graphics
Archive   : SPIN.ZIP
Filename : COLORS.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/