[Gambas-user] Ask about com access

jose julio vidal jj at ...1636...
Mon Dec 8 01:21:49 CET 2008


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!


El dom, 07-12-2008 a las 09:48 -0500, Stephen Bungay escribió:
> I wrote a complete POS in GAMBAS but the cash drawer was connected to 
> the parallell device.. however, I did dump text to an LED pole display, 
> to show the customer how much they owed and the change due etc. Should 
> be fairly similar, knowing the control codes to send to the cash drawer 
> might be the difficult part (might not be well documented).
> 
> PUBLIC SUB OutputToPoleDisplay(pOutputString AS String)
>    DIM ShellString AS String
>    ClearPoleDisplay
>    ShellString = "echo -ne \"" & pOutputString & "\" > /dev/ttyS0"
>    SHELL ShellString WAIT
> END
> 
> PUBLIC SUB ClearPoleDisplay()
>     SHELL "echo -ne \"\n\n\n\" > /dev/ttyS0" WAIT
> END
> 
> Regards
> Steve :)
> 
> Leo Sendra wrote:
> > Hi all, I want to ask.. How to access a com port in gambas? I want my program to access a cash drawer using gambas.
> > 
> > Thanks...
> > 
> > 
> > 
> >       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
> > 
> 
> ------------------------------------------------------------------------------
> 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





More information about the User mailing list