// BLATTDR.prg - fllt ein Formular aus PROCEDURE BlattDR( nArea, cDatei, cTitle, oDlg, nXsize, nYsize ) LOCAL nOldArea := Select(), aSchrift := {} SELECT 12 USE Drubef IF Upper( cDrucker ) == "HP" AAdd( aSchrift, Trim( 12->hpnorm ) ) Aadd( aSchrift, Trim( 12->hp12p ) ) Aadd( aSchrift, Trim( 12->hp14p ) ) Aadd( aSchrift, Trim( 12->hpres1 ) ) Aadd( aSchrift, Trim( 12->hpres2 ) ) Aadd( aSchrift, Trim( 12->hpres3 ) ) Aadd( aSchrift, Trim( 12->hpres4 ) ) nPoffY := Val( Substr( 12->hpres5, 1, 3 ) ) nPoffX := Val( Substr( 12->hpres5, 4, 3 ) ) nPpZ := Val( Substr( 12->hpres5, 7, 3 ) ) nPpS := Val( Substr( 12->hpres5, 10, 3 ) ) ELSE Aadd( aSchrift, Trim( 12->epnorm ) ) Aadd( aSchrift, Trim( 12->ep12p ) ) Aadd( aSchrift, Trim( 12->ep14p ) ) Aadd( aSchrift, Trim( 12->epres1 ) ) Aadd( aSchrift, Trim( 12->epres2 ) ) Aadd( aSchrift, Trim( 12->epres3 ) ) Aadd( aSchrift, Trim( 12->epres4 ) ) nPoffY := Val( Substr( 12->epres5, 1, 3 ) ) nPoffX := Val( Substr( 12->epres5, 4, 3 ) ) nPpZ := Val( Substr( 12->epres5, 7, 3 ) ) nPpS := Val( Substr( 12->epres5, 10, 3 ) ) ENDIF USE cDRnorm := aSchrift[1] SET DEVICE TO PRINTER SET PRINTER ON SetPrc( 0, 0 ) USE &cDatei DO WHILE .NOT. Eof() cText := Trim( 12->text ) nTextFont := 12->textfont cFeld := Trim( 12->feld ) nFeldFont := 12->feldfont nZei := (12->zeile) nSpa := (12->spalte) SELECT &nArea IF len(cFeld)>0 DO CASE CASE Valtype( 1->(&cFeld) ) == "C" ZS( nZei, nSpa ) FDr( Trim( cText ), aSchrift[4] ) FDr( Trim( 1->(&cFeld) ), aSchrift[1] ) CASE Valtype( 1->(&cFeld) ) == "N" ZS( nZei, nSpa ) FDr( Trim( cText ), aSchrift[4] ) FDr( Trim( Str( 1->(&cFeld) ) ), aSchrift[1] ) CASE Valtype( 1->(&cFeld) ) == "D" ZS( nZei, nSpa ) FDr( Trim( cText ), aSchrift[4] ) FDr( Trim( DtoC( 1->(&cFeld) ) ), aSchrift[1] ) ENDCASE ELSE ZS( nZei, nSpa ) FDr( Trim( cText ), aSchrift[4] ) ENDIF SELECT 12 SKIP ENDDO USE EJECT SET DEVICE TO SCREEN SELECT &nOldArea RETURN FUNCTION ZS( nZei, nSpa ) LOCAL nRow := PRow() , nCol := PCol() IF Upper( cDrucker ) == "HP" IF nZei<80 QQOut( Chr(27)+"*p"+LTrim(Str(nPoffY+Int(nZei*nPpZ),4,0))+"Y" ; + Chr(27)+"*p"+LTrim(Str(nPoffX+Int(nSpa*nPpS),4,0))+"X" ) ELSE QQOut( Chr(27)+"*p"+LTrim(Str(nPoffY+nZei,4,0))+"Y" ; + Chr(27)+"*p"+LTrim(Str(nPoffX+nSpa,4,0))+"X" ) ENDIF ELSE ENDIF RETURN SetPrc( nRow, nCol ) FUNCTION Fdr( cFeldText, cSchrift ) LOCAL nRow := PRow() , nCol := PCol() IF cSchrift<>"" QQOut( Chr(27)+cSchrift ) ENDIF SetPrc( nRow, nCol ) QQOut( Trim( cFeldText ) ) nRow := PRow() ; nCol := PCol() QQOut( Chr(27)+cDRnorm ) RETURN SetPrc( nRow, nCol )