Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > serial class
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 11377 of 11560
Post > Topic >>

serial class

by danijel.koprivnjak@[EMAIL PROTECTED] May 8, 2008 at 06:09 AM

Hi !

Maybe anybody can help me .I must printing on serial pos printer and
using SERIAL CLASS
(trying FAB SERIAL CLASS also)

in my print function

IF lSerialPrint
	oSerial:=Serial{}
	oSerial:OPEN(pParams.cPrintFileName)

	ptrHandle:=FOpen(cTempPath+"SERIAL.TXT",FO_READ+FO_SHARED)

	WHILE Citaj(@[EMAIL PROTECTED]
)

            cLinija:=cLinija+CRLF
  	    oSerial:Write(cLinija)
//	    Sleep(500)
	END

    oSerial:CLOSE()
    FClose(ptrHandle)
    FErase(String2Psz(cTempPath+"SERIAL.TXT") )

ENDIF

STATIC FUNCTION Citaj(Simbol,handle, zavrsetak )

LOCAL ret_val := TRUE
LOCAL buffer
LOCAL bytes
LOCAL bufsize := 512
LOCAL tempstring
LOCAL ptrValue

buffer := Space(bufsize)
Simbol:=""
WHILE .T.
   bytes := FRead(handle, @[EMAIL PROTECTED]
 bufsize)
   tempstring := Left(buffer, bytes)
   IF ( ptrValue := At(Zavrsetak, tempstring) ) > 0
      Simbol += SubStr(tempstring, 1, ptrValue - 1)
      FSeek(handle, -(bytes - (ptrValue+1 )), FS_RELATIVE)
      EXIT
   ELSE
      Simbol += tempstring
      IF bytes < bufsize
         ret_val := .F.
         EXIT
      ENDIF
   ENDIF
END

RETURN ret_val


if not put SLEEP() printer stop printing after approx. 40 bytes but if
put sleep(500) it is to slowly

thank you

Danijel
 




 4 Posts in Topic:
serial class
danijel.koprivnjak@[EMAIL  2008-05-08 06:09:30 
Re: serial class
"Ginny Caughey"  2008-05-08 10:18:01 
Re: serial class
"Ginny Caughey"  2008-05-08 10:37:42 
Re: serial class
"Alessandro Antonang  2008-05-08 18:36:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:10:50 CDT 2008.