home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7455 < prev    next >
Encoding:
Text File  |  1992-12-14  |  3.1 KB  |  89 lines

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!caen!batcomputer!ghost.dsi.unimi.it!univ-lyon1.fr!cismibm.univ-lyon1.fr!ppollet
  2. From: ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: HOW USE PRINTER FROM A PROGRAM....
  5. Date: Mon, 14 Dec 1992 15:52:32 GMT
  6. Organization: INSA  CENTRE INFORMATIQUE DU 1er CYCLE
  7. Lines: 77
  8. Message-ID: <ppollet.70.724348352@cismibm.univ-lyon1.fr>
  9. References: <1992Dec14.135919.12430@tolten.puc.cl>
  10. NNTP-Posting-Host: 134.214.232.25
  11.  
  12. In article <1992Dec14.135919.12430@tolten.puc.cl> icarus@ing.puc.cl (Eduardo Jimenez) writes:
  13. >From: icarus@ing.puc.cl (Eduardo Jimenez)
  14. >Subject: HOW USE PRINTER FROM A PROGRAM....
  15. >Date: Mon, 14 Dec 1992 13:59:19 GMT
  16.  
  17. > hello, well i just have two problems programing pascal.(I'm a novice),
  18. > i want to know how to print a txt file from a program wrote in pascal,
  19. > ......
  20.  
  21. Two ways (by standard Pascal )plus many others using Dos,Bios....
  22.  
  23.    - Include a Uses printer atop of your program and dump the Text file to 
  24. it:
  25.       such as :
  26.         var MyText:Text;
  27.             aLine:String;
  28.   
  29.         Assign(MyText,'TEXTFIL.TXT');
  30.         Reset(MyText);
  31.         While Not Eof(MyText) do
  32.           begin
  33.              Readln(MyText,aLine);
  34.              Writeln(lst,aLine);
  35.                      ^^^  a text file automatically associated to PRN: 
  36.                           by the unit Printer 
  37.           end;
  38.         Close(MyText);
  39.  
  40.    -Otherwise you may use a second text file say MyOutput:Text and
  41.     assign it to 'PRN'
  42.            .....
  43.            Assign(MyOutPut,'PRN');
  44.            Rewrite(MyOutPut);
  45.            While Not Eof(MyText) do
  46.              begin
  47.                 readln(MyText,aLine);
  48.                  writeln(MyOutput,aLine);
  49.               end;
  50.            Close(MyText);Close(MyOutput)
  51.            .......    
  52.   
  53.  
  54. > The second problem is how to call others program from other, for instance I
  55. >have to make a program more big than 64k, so I split it in few parts, then 
  56. >i'll call them, but how...?
  57. > Pd: im working with Turbo Pascal 6.0    
  58.  
  59.     With TP6 there is no need to split programs that are bigger than 64K. 
  60.     You can use Units, and Get a limit a 64K of compiled code per unit  
  61.     Furthermore, with overlays, the size of your program may exceed the
  62.     available memory... So why bother ? 
  63.  
  64.     Nevertheless, if you want to call another program, check in your 
  65. manual for instruction Exec(NameofTheProgram,CommandLine).
  66. There is no problem calling another program off Turbo. To make them 
  67. communicate , say with common variables.... is another story. You have time
  68. to learn it .....
  69.  
  70.  
  71. > If somebody can help me I'll be gratefull
  72.  
  73.  
  74. > Eduardo J. Aleuy
  75. > ICARUS@MALLOCO.ING.PUC.CL
  76.  
  77.  
  78. ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  79. --------------------------------------------------------
  80. Dr Patrick L.Pollet
  81. Institut National des Sciences Appliquées
  82. Centre Informatique du 1er Cycle  Bat 110
  83. 20 Avenue A.Einstein
  84. 69621 Villeurbanne Cedex France
  85. --------------------------------------------------------
  86. Phone: 72 43 83 80 -   la premiere erreur c'est
  87. Fax  : 72 43 85 33 -   de se lever le matin  ... GASTON
  88. -------------------------------------------------------
  89.