I have a simple app that is currently using an SDK, but this is causing memory problems, and I also want the app to run on multiple hand-held scanner types without being redone for each platform, if possible. So I decided to use the data wedge.
The scanned text is read into a text box (one character at a time) from the data wedge, the problem is the input from the scanner can be of varying lengths, so I need to capture the default [CR][LF] (carriage return and line feed) characters that are set in the post amble.
I've tried comparing the last characters of the string against Chr(13) and Chr(10) but couldn't get this to work. I'm using the TextChanged property of the text box to check for input to the box -
Private Sub tbx_Scan_TextChanged() Handles TBX_Scan.TextChanged
And want to return a valid result from this function if an end-of-line is found
Public Function CheckLocationInput(ByVal inputString As String) As String
If (Len(inputString) >= 5) And (Len(inputString) <= 40) Then
If inputString.Contains(Environment.NewLine) Then
Return "VALID" 'Opens the Item Input Screen
End If
But the [CR] and [LF] characters don't seem to be entered into the text box, or at least can't seen to be read. Basically all I'm trying to do is check for the end of the data wedge input. I can do this if I change the post-amble to a string E.g. '~E%'
I know the arguments against doing this this, but it should be a simple app, so I'd appreciate no, "you should use the SDK" answers.
So what is the best way to capture the non-printable characters using VB.net and/or C# from a data-wedge input?
Thank you.
I couldn't get this reading a non-printable character from the end of the input to a text box. but I did manage to get around it by putting the following in the form. Then using Barcoding as my input string, as this does contain the non-printable codes at the end.