* * *  S W L I S T       Modul von SWORT
* * *                    Ausgeben einer kompletten Stichwortliste
* * *                    auf den Drucker

ERASE
STORE "                    " TO BLANK20
STORE "     " TO SWALT

@ 2,20 SAY "Gesamtliste ausdrucken"
@ 3,20 SAY "======================"
@ 5,20 SAY " "
? "Anlegen der Hilfsdatei l{uft"

STOR LEN(STICHWORT1) TO SWLEN
COPY TO B:HILF STRUCTURE EXTENDED
SELECT SECONDARY
USE B:HILF
DELETE ALL
PACK
APPEND BLANK
REPLACE FIELD:NAME WITH "SWNR",FIELD:TYPE WITH "N",FIELD:LEN WITH 4
APPEND BLANK
REPLACE FIELD:NAME WITH "HAUPTSW",FIELD:TYPE WITH "C",FIELD:LEN WITH SWLEN
APPEND BLANK
REPLACE FIELD:NAME WITH "FELDNR",FIELD:TYPE WITH "N",FIELD:LEN WITH 1
CREATE B:HILF1 FROM B:HILF
USE B:HILF1
DELETE FILE B:HILF
? "Erstellen der Hilfsdatei l{uft"
SELECT PRIMARY
GO TOP
DO WHILE .NOT. EOF
  STORE # TO MSWNR
  SELECT SECONDARY

  IF STICHWORT1 <>"    "
    APPEND BLANK
    REPLACE SWNR WITH MSWNR,HAUPTSW WITH STICHWORT1,FELDNR WITH 1
  ENDIF
  IF STICHWORT2 <>"    "
    APPEND BLANK
    REPLACE SWNR WITH MSWNR,HAUPTSW WITH STICHWORT2,FELDNR WITH 2
  ENDIF
  IF STICHWORT3 <>"    "
    APPEND BLANK
    REPLACE SWNR WITH MSWNR,HAUPTSW WITH STICHWORT3,FELDNR WITH 3
  ENDIF
  SELECT PRIMARY
  SKIP
ENDDO

? "Sortieren der Hilfsdatei l{uft"
SELECT SECONDARY
SORT ON HAUPTSW TO B:HILF
USE B:HILF
DELETE FILE B:HILF1
STORE $(DATE(),4,2)+"."+$(DATE(),1,2)+"."+$(DATE(),7,2) TO DATUM
STORE 1 TO SEITNR
SET PRINT ON

DO WHILE .NOT. EOF
  ? BLANK20 +"Gesamtstichwortliste"+"     "+"Datum: "+DATUM;
    +"     Seite:"+STR(SEITNR,4)
  ?
  ?
  STORE SEITNR + 1 TO SEITNR
  STORE 3 TO ZEILE
  DO WHILE ZEILE < 60 .AND. .NOT. EOF
    IF HAUPTSW <> SWALT
      ? HAUPTSW
      STORE HAUPTSW TO SWALT
      STORE ZEILE+1 TO ZEILE
    ENDIF

    SELECT PRIMARY
    GO S.SWNR
    IF FELDNR = 1
      STORE STICHWORT2 TO SW1
      STORE STICHWORT3 TO SW2
    ENDIF
    IF FELDNR = 2
      STORE STICHWORT1 TO SW1
      STORE STICHWORT3 TO SW2
    ENDIF
    IF FELDNR = 3
      STORE STICHWORT1 TO SW1
      STORE STICHWORT2 TO SW2
    ENDIF

    STORE "Z"+STR(ZNR,1) TO ZS
    ? "          "+SW1+"  "+SW2+"  "+"Seite"+STR(SEITE,4);
      +"  "+STR(AUSGABE,2)+"/"+STR(JAHR,2)+" "+ &ZS

    STORE ZEILE + 1 TO ZEILE
    SELECT SECONDARY
    SKIP
  ENDDO
  ? CHR(12)
ENDDO

?
SET PRINT OFF
SELECT SECONDARY
USE B:SWORT
SELECT PRIMARY
DELETE FILE B:HILF
RELEASE SWLEN,MSWNR,BLANK20,SEITE,ZEILE,SWALT,SW1,SW2
RETURN





IELD:NAME WITH "SWNR"O SW2
    ENNR = 3
      STORE STICHWORT1 TO SW1
      STORE STICHWORT2 TO SW2
    ENDIF

    STORE "Z"+STR(ZNR,1) TO ZS
    ? "          "+SW1+"  "+SW2+"  "+"Seite"+STR(SEITE,4);
      +"  "+STR(AUSGABE,2)+"/"+STR(JAHR,2)+" "+ &ZS

    STORE ZEILE + 1 TO ZEILE
    SELECT SECONDARY
    SKIP
  ENDDO
  ? CHR(12)
ENDDO

?
SET PRINT OFF
SELECT SECONDARY
USE B:SWORT
SELECT PRIMARY
DELETE FILE B:HILF
RELEASE SWLEN,MSWNR,BLANK20,SEITE,ZEILE,SWALT,SW1,SW2
RETURN





