[Solved] Convert BASIC to Gambas

Post your Gambas programming questions here.
AndyGable
Posts: 349
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Re: Convert BASIC to Gambas

Post by AndyGable »

Hi Everyone

I have sorted out the first part of my scanner / scale module the barcode number is being sent perfecvtly everytime now

What I did was this

Code: Select all

Sleep 0.025
        Try Read #RS232Scanner, Global.ScannerData, Lof(RS232Scanner)
    
    If Error Then
        Print "Error With Incoming Serial Data"
    Endif
    
    If Len(Global.ScannerData) > 2 Then
        Print "Raw Barcode Number : " & CStr(Global.ScannerData)
        CleanUpBarcodeData(CStr(Global.ScannerData))
    Endif
End
 
and then to send the barcode number to the PoS terminal i used

Code: Select all

Private Sub CleanUpBarcodeData(BarcodeNumber As String)
    Dim TempNumber As String     

    If Global.Scanner_RemoveChrs > 0 Then
        TempNumber = Mid$(BarcodeNumber, Global.Scanner_RemoveChrs, Len(BarcodeNumber))
    End If

    
    Print "Processed barcode Number : " & Trim(TempNumber)
    
    Global.AddToListBox("Barcode Number sent to PoS :" & TempNumber)
End
And this works every time :) I just need to work out how to send the request to the Scanner to send the weight back
Post Reply