Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printer not Ready
Message
De
20/08/2003 15:37:41
 
 
À
20/08/2003 09:18:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00821753
Message ID:
00821968
Vues:
31
This works for me in VFP6, VFP7, and VFP8 using any Okidata dot matrix printer in IBM Proprinter emulation mode:
*--Print condensed print and then print 10cpi to an Okidata
ptrcond="27, 15"  && condensed printing
ptrstan="18"      && 10 cpi printing
ptrrest="27"      && reset

av_cond=ptr_code(ptrcond)
av_stan=ptr_code(ptrstan)
resetopt=ptr_code(ptrrest)
port=GETPRINTER()  && Choose an Okidata dot matrix
set console OFF
SET PRINTER TO NAME (port)
set device to print
set PRINTER on
??? av_cond
? "line 1 and this is a test in condensed print."
??? av_stan
??? resetopt
? "line 2 and this is a test in 10cpi"
EJECT
set PRINTER off
set printer to
SET DEVICE TO SCREEN
set console on
RETURN

FUNCTION ptr_code
PARAMETERS ptr_string

PRIVATE pos,p_code

pos = 0			   && Position of comma
xpos = 0		   && Ending quote mark
p_code = ""		   && Actual printer code

*Start with p_code equal to the first number as a CHR()

IF !EMPTY(ptr_string)
	p_code = CHR(VAL(ptr_string))

	DO WHILE .T.
		pos = AT(",",ptr_string)
		IF pos = 0
			EXIT
		ENDIF
		IF SUBSTR(ptr_string,pos+1,1) = '"'
			xpos = AT('"',ptr_string,2)
			p_code = p_code + SUBSTR(ptr_string,pos+2,xpos-(pos+2))
			ptr_string = SUBSTR(ptr_string,xpos+1)
		ELSE
			ptr_string = SUBSTR(ptr_string,pos+1)
			p_code = p_code + CHR(VAL(ptr_string))
		ENDIF
	ENDDO
ENDIF

RETURN p_code
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform