Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?

View SAMPLES\COM1PORT.PAS

Portable ISO Standard Pascal in C, version 3.8

Submitted By: WEBMASTER
Rating: starstarstarstar (Rate It)


(*$c+*)
program print(com1);
const x =
 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var i, j : integer;
   com1 : text;
begin
{ PROGRAM FOR WRITING TO THE com1 PORT OF A PC; THE }
{ SAME METHOD CAN BE USED TO READ FROM A COM PORT OR }
{ TO WRITE TO DEVICES LIKE lpt1, WHICH CAN BE OPENED }
{ AS FILES. SEE YOUR OPERATING SYSTEM MANUAL FOR THE }
{ DETAILS. }
 write('Type in the number of repetitions: ');
{ NOTE THAT READLN READS IN THE INTEGER AND THEN CONSUMES }
{ THE END OF LINE THAT YOUR PRESSING OF THE 'ENTER' KEY }
{ PRODUCES: }
 readln(i);
 for j := 1 to i do
  begin
   writeln(x);
   writeln(com1, x)
  end
end.

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.