[Gambas-user] Ask about com access
jose julio vidal
jj at ...1636...
Mon Dec 8 19:37:31 CET 2008
Hi! it's very easy, but, You should make sure that your device is
the /dev/lp0, otherwise change the device in the code.
' Gambas class file
PUBLIC SUB Button1_Click()
DIM hFile AS File
DIM codeopencash AS String
codeopencash = "Chr$(27) & Chr$(112) & Chr$(0) & Chr$(27) & Chr$(112) &
Chr$(1)"
hFile = OPEN "/dev/lp0" FOR WRITE
IF ERROR THEN
message.Error("No se puede acceder a la Caja")
ELSE
WRITE #hFile, Eval(codeopencash)
END IF
END
regards
El lun, 08-12-2008 a las 21:29 +0800, Leo Sendra escribió:
> Hi Jose.. If you don't mind, would you like to send me a code in Gambas??
> I really need a code to open cash drawer...
>
> I really appreciate for your help...
>
> Thanks...
>
> >Hi all! I also wrote a program pos in gambas :)
> >I open the cash drawer as follows:
>
>
> >C (constants): Gambas module file
> >---------------------------------
> >PUBLIC codeopencash AS String = ""
> >....
> >codeopencash=Chr$(27) & Chr$(112) & Chr$(0) & Chr$(27) & Chr$(112) & Chr
> >$(1)
> >.....
>
>
>
> >F (functions): Gambas Module File
> >---------------------------------
>
> >PUBLIC SUB abrir_caja()
>
> >DIM hFile AS File
>
> >hFile = OPEN "/dev/lp0" FOR WRITE
> >IF ERROR THEN
> > message.Error("No se puede acceder a la Caja")
> >ELSE
> > WRITE #hFile, Eval(c.codeopencash)
> >END IF
>
> >END
>
>
> >Regards!
>
>
> Menambah banyak teman sangatlah mudah dan cepat. Undang teman dari Hotmail, Gmail ke Yahoo! Messenger sekarang! http://id.messenger.yahoo.com/invite/
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opencash.zip
Type: application/zip
Size: 9343 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20081208/73e3a02c/attachment.zip>
More information about the User
mailing list