[Gambas-user] How to sent a line line to a lp1 printer and form to lp0 printer directly.

Ron ron at ...1740...
Thu Sep 24 13:40:16 CEST 2009


You forgot the slash before dev/lp1  or is that a typo?

So

hPrinter = OPEN "dev/lp1" FOR OUTPUT

Gets

hPrinter = OPEN "/dev/lp1" FOR OUTPUT

Regards,
Ron_2nd.

> Thank you all for your help.
>
> I have tried the following printing SUB:
>
> PUBLIC SUB bEktiposi_Click()
> 	DIM hPrinter AS Printer
> 	DIM hFile AS File
> 	hPrinter = OPEN "dev/lp1" FOR OUTPUT
> 	hPrinter.EndOfLine = gb.Windows
> 	PRINT #hFile, "test a line: ";
> 	CLOSE hPrinter
> END
>
> It is compiled but it stops when bEtiposi Button is clicked
> at line :
> hPrinter = OPEN "dev/lp1" FOR OUTPUT
> with the message:
> " Access Forbidden. "
>
> I have tried to print from terminal with commands
> echo -e "Hello World\r" > /dev/lp1 
> cat /etc/passwd > /dev/lp1
> They have both worked only with root terminal.
>
> First question:
> How exactly can I put echo into SHELL command of Gambas?
>
> Second question:
> I suppose that's the reason why the routine OPEN "dev/lp1" .... is not 
> working. It needs root privileges! 
> Is there any other way to setup the printer /dev/lp1 in order to work with 
> simple user privileges? 
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>   





More information about the User mailing list