is it possible to make a Screenless application in Gambas? I ask as I have a lot of Point of sale Printers that I support and I was thinking about creating a "driver" app for each printer.
If it is possible can i use Socket in Gambas so the apps can talk to each other?
Also last question can I convert BASIC code to Gambas?
Code: Select all
Sub StandardCashDrawer
Dim As String A, B, keyprs
Dim aint As Integer
Dim t As Double
Dim errflag As Integer
Dim timeropen As Double
Do
a = Input$(LOC(PoSPrinter),1) 'clears data from serial buffer
a = ""
If JournalType = "Paper" Then
Print #PoSPrinter, ESC ; "="; Chr(1); ' Select Printer ONLY
EndIf
Print #PoSPrinter, Chr(29);Chr(114);Chr$(2); ' get the status from the printer
errflag = 0
t = Timer
If cashdrwopen <> 9999 Then timeropen = Timer
While Loc(PoSPrinter) = 0
If Timer - t > TimeOutLimit Then
cashdrwopen = -1
Exit Do
End If
Sleep 1
Wend
A = Input$(PoSPrinter,1)
Aint = Val("&H" & Hex(Asc(A),2))
If (Aint And 1) = 0 Then ' Cash Drawer open
a = ""
CashDrwOpen = 9999
If CashDrawerAudioAlarm ="Yes" Then
If Timer - timeropen > 30 Then
Sound(c1, dur)
font.fontindex = 3 'small font
font.backcolor = Black
font.forecolor = white
font.drawstring (," C L O S E D R A W E R ",200,360)
End If
End If
End If
If (Aint And 1) = 1 Then ' Cash Drawer closed
Exit Do
End If
Sleep 100
Loop
If CashDrwOpen = -1 Then
'comm timeout
Locate 1,1
Print "No response from cash drawer"
Else
If CashDrawerFucntion = "SaleScreen" Then
dailyCash -= ChangeDue 'update the cash figure with the change out
DailyCustomerCount += 1 'add 1 to customer count
If MSSavedValue > 0 And PrintMSSummary = "No" Then YouSavedTodayPrint
Select Case PrintReciptOption
Case "Allways"
SelectEndOFRecipitPrint
Case "AtClose"
PrintRecipit ' Prints recpit when the cash drawer closes
End Select
CreateTimeSaleFile
DisplayMovingMessgae
ResertDataFigures
End If
If CashDrawerFucntion = "NoSale" Then
DailyNosale += 1
DisplayMovingMessgae
ResertDataFigures
End If
If CashDrawerFucntion = "SafeDrop" Then
ResertDataFigures
End If
End If
End Sub