Inhalt
Index
Support Über uns
Home

6.7 Beispielprogramme




6.7.1 print1.cob


       identification division.
       environment division.
       data division.
       working-storage section.
       01 name         pic x(50).
       01 stat         pic 9(5).
       procedure division.


      * Drucker auswählen


        call getprinterdialog using name stat.


        if stat not = 0 stop run.


        call print using  
          'a "f+ p=50 r=255 w=45" p 2000 9700 u "Muster"'.
        call prclose.





6.7.2 print2.cob


       identification division.
       environment division.
       data division.
       working-storage section.
       01 name         pic x(50).
       01 stat         pic 9(5).
       procedure division.


      * Drucker auswählen


        call getprinterdialog using name stat.


        if stat not = 0 stop run.
      *
      * Position 2 cm von links 9,7 cm von oben
      * Fettdruck Schriftgröße 50
      * Winkel 45 Grad (schräg schreiben)
      * 
        call print using  
          'a "f+ p=50 r=255 w=45" p 2000 9700 u "Muster"'.


      *
      * Rotanteil = 0 --> schwarz drucken
      * Winkel auf 0 (normal)
      * Strichstärke auf 10 setzen
      * Schriftgröße 8
      * 


        call print using 'a "r=0 w=0 d=10 p=8"'.


      *
      *  Positionierung auf 2,5 cm von links 6 cm von oben
      *  
        call print using 'p 2500 6000'.
      *
      * Tabelle zeichnen: 7 cm breit 6 cm hoch, 4 Spalten 5 Reihen
      * 
        call print using 'td 7000 6000 4 5'.
      *
      * Die Textausrichtung der Tabelle vertikal mittig und horizontal 
      * auf links setzen.
      * 
        call print using 'tj lm'.
      *
      * Text in die 1. Zeile setzen. Nach dem Text muß ein Punkt angegeben
* werden      * werden!
      * 
        call print using 'tw 1 1 "Zelle 1". tw 2 1 "Zelle 2"'.
      *
      * Die Textausrichtung der Tabelle vertikal oben und horizontal 
      * auf rechts setzen. Beim Zellen beschreiben können auch mehrere
      * Texte angeben werden (bis zum Punkt).


        call print using 
               'tj ro tw 3 1 "Zelle" " 3". tj mu tw 4 1 "Zelle 4"'.


        call prclose.


6.7.3 print3.cob


       identification division.
       environment division.
       data division.
       working-storage section.
       01 name         pic x(50).
       01 stat         pic 9(5).
       01 max          pic 9(5).
       01 len          pic 9(7).
       01 x            pic 9(5).
       01 xs           pic 9(5).
       01 y            pic 9(5).
       01 ys           pic 9(5).
       01 yp           pic 9(5).
       01 cur          pic 9(5).       
       01 upd          pic 9(5).       
       01 colf.
        02 filler      pic 9(9) value 255128000.
        02 filler      pic 9(9) value 034121208.
        02 filler      pic 9(9) value 214029145.
        02 filler      pic 9(9) value 000223000.
        02 filler      pic 9(9) value 026196193.
        02 filler      pic 9(9) value 189100034.
        02 filler      pic 9(9) value 034050189.
        02 filler      pic 9(9) value 166000000.
        02 filler      pic 9(9) value 128000128.
        02 filler      pic 9(9) value 186048114.
       01 col redefines colf pic 9(9) occurs 10 indexed i.
       77 texi        pic 9.
       procedure division.


      * Drucker auswählen


        call getprinterdialog using name stat.


        if stat not = 0 stop run.


        move 200 to cur.
        move 1000 to x max.
        move 150 to upd.
        move 3500 to y ys.
        move 5000 to yp.
        set i to 1.
      *
      *  FillRect: X-Position Höhe und Farbe werden als Argumente übergeben
      *  1. Grafik     von x=1000 bis 10000, y=2500 bis 3500
      *  2. Grafik     von x=1000 bis 10000  y=5000 bis 8000 
      *  
        call print using 'fo "Verdana" 8'.
       loop.
        compute len = 1000 * cur / max.
        compute y = ys - len.
        call print using 'fi ^1 ^2 1000 ^3 ^4' x y len col (i).
        compute len = len * 9.
        call print using 'fi 1000 ^1 ^2 250 ^3' yp len col (i).
        set texi to i.
        compute y = y - 500.
        call print using 'j ^1 ^2 1000 500 "mu" "Text" ^3' x y texi.
        compute xs = len + 1020.
        compute y = yp - 100.
        call print using 'j ^1 ^2 1000 450 "lm" "Text" ^3' xs y texi.
        add 1000 to x.
        add 300 to yp.
        set i up by 1.
        compute cur = cur + upd.
        if cur > max move -220 to upd
                     move 900 to cur.
        if cur < 0 move 700 to cur.
        if i < 11 go to loop.                                 
      *
      * Grafiken umrahmen und Text hinterlegen
      * 
      *  1. Grafik     von x=1000 bis 11000, y=2500 bis 3500
       call print using 'fo "Verdana" 11'.
       call print using 'a "f+"'.
       call print using 'bo 500 2000 11000 2500'.
       call print using 'j  500 4000 11000 500 mm "Grafik Nr. 1"'.
      *  2. Grafik     von x=1000 bis 10000  y=5000 bis 7850 
       call print using 'bo 500 4500 11000 4500'.
       call print using 'j  500 8500 11000 500 mm "Grafik Nr. 2"'.
       call prclose.




6.7.4 print4.cob


       identification division.
       environment division.
       data division.
       working-storage section.
       01 name         pic x(50).
       01 stat         pic 9(5).
       procedure division.


      * Drucker auswählen


        call getprinterdialog using name stat.


        if stat not = 0 stop run.


      * Schriftart auswählen


        call print using 'fo arial 8'.


      * Text ausrichten



        call print using 'j  1000 1000 2000 1000 lo "links oben"'.
        call print using 'bo 1000 1000 2000 1000'.


        call print using 'j  4000 1000 2000 1000 mo "mittig oben"'.
        call print using 'bo 4000 1000 2000 1000'.


        call print using 'j  7000 1000 2000 1000 ro "rechts oben"'.
        call print using 'bo 7000 1000 2000 1000'.


        call print using 'j  1000 2500 2000 1000 lm "links mitte"'.
        call print using 'bo 1000 2500 2000 1000'.


        call print using 'j  4000 2500 2000 1000 mm "mitte mitte"'.
        call print using 'bo 4000 2500 2000 1000'.


        call print using 'j  7000 2500 2000 1000 rm "rechts mitte"'.
        call print using 'bo 7000 2500 2000 1000'.


        call print using 'j  1000 4000 2000 1000 lu "links unten"'.
        call print using 'bo 1000 4000 2000 1000'.


        call print using 'j  4000 4000 2000 1000 mu "mitte unten"'.
        call print using 'bo 4000 4000 2000 1000'.


        call print using 'j  7000 4000 2000 1000 ru "rechts unten"'.
        call print using 'bo 7000 4000 2000 1000'.


        call prclose.




6.7.5 print5.cob

      *c32 %;slink §
       identification division.
       environment division.
       data division.
       working-storage section.
       01 name         pic x(50).
       01 stat         pic 9(5).
       procedure division.


      * Drucker auswählen


        call getprinterdialog using name stat.


        if stat not = 0 stop run.
        call print using 'fo "Arial" 8'.


        call print using  
          'b "bilder\saturn.bmp" 1000 1000 2000 -1'.
        call print using 
         'p 1000 3000 o."Saturn.bmp"'.
        call print using 
         'p 1000 3300 o."originales Seitenverhältnis"'.
        call print using
          'b "bilder\saturn.bmp" 1000 4000 2500 2000'.
        call print using  'p 1000 6500 o."Saturn.bmp"'.
        call print using  'p 1000 6800 o."mit 2500 2000"'.


        call print using  
          'b "bilder\saturn.jpg" 7000 1000 1500 1000'.
        call print using 'p 7000 2500 o."Saturn.jpg"'.
        call print using 'p 7000 2800 o."mit 1500 1000"'.


        call print using
          'b "bilder\saturn.jpg" 7000 4000 -1 2000'.
        call print using 'p 7000 6500 o."Saturn.bmp"'.
        call print using 'p 7000 6800 o."originales Seitenverhältnis"'.


        call prclose.


6.7.6 print6.cob

      *c32 %;slink §
       identification division.
       environment division.
       data division.
       working-storage section.
       01 name         pic x(50).
       01 stat         pic 9(5).
       procedure division.


      * Drucker auswählen


        call getprinterdialog using name stat.


        if stat not = 0 stop run.
        call print using '<print1.pms>'.
        call print using 'o 5000 0'.
        call print using '<print1.pms>'.
        call print using 'o 0  2000'.
        call print using '<print1.pms>'.
        call print using 'o 5000  2000'.
        call print using '<print1.pms>'.
        call prclose.


6.7.7 print1.pms


       !Tab1           1000
       !Tab2           3400


       p Tab1 2000 o.  "Test1"
       p Tab1 2500 o.  "Text1"


       p Tab2 2000 o.  "Test2"
       p Tab2 2500 o.  "Text2"







Zurück zu Druckaufträge steuern    Hoch zu Grafischer Druck mit Acc-Cobol in MS-Windows-Systemen
Entwickler Portal Impressum AGB Kontakt


© 1980-2017 Acc Computertechnik GmbH All rights reserved.