SendEscapeCodes()
Sends printer control codes directly to the printer.
Syntax
SendEscapeCodes(<xData>) --> cDataSent
Arguments
<xData> --> This may either be a character string, an ASCII code number or an array of ASCII code numbers. ASCII code numbers must be in the range 0-255.
Returns
Returns the data sent to the printer formatted as a character string.
Description
This is a special purpose function used to send escape control codes directly to the printer. For the vast majority of printers it should be unnecessary to need to send control codes directly. The function may be useful to allow you to activate a feature of the printer not supported by the Windows printer driver you are using. (However it is always a better option to try to obtain the correct printer driver if possible.)
For example, aligning the page to the tear-off position or selecting an alternative paper tray if your printer driver does not recognise it.
Regardless of when you execute the SendEscapeCodes() function, escape codes are typically sent to the printer before "normal" page printing occurs. This is because Visual Builder does not submit data to the print queue until an entire page of information has been created. The SendEscapeCodes() function, however, sends data to the print queue immediately.
Examples
* Send a string to printer
SendEscapeCodes("Testing")
* Send ASCII codes as a string
SendEscapeCodes(CHR(27) + CHR(0))
* Send ASCII code 12 to the printer
SendEscapeCodes(12)
* Send an array of ASCII codes
SendEscapeCodes( { 27, 1, 2, 3, 4, 5 } )
SendDirect()
which is faster than SendEscapeCodes() and can be used to send data to devices other than the print job
destination printer.
____________________________
Related Topics: