Subject Re: Does dbase work with pole display
From <rich@autotraker.com> <<rich@autotraker.com>>
Date Tue, 8 Oct 2019 12:54:12 -0400
Newsgroups dbase.getting-started

Been a long time for me too but looking at some code I have for a cash
drawer
I am setting display messages off. I think that prevented some erroneous
error messages.
serialComm1.displayMessages = false
And sending a single character I had to repeat the same character multiple
times.
if len(SendString)=1
    CashDrawerWidth = 10 // not sure where I got the number 10 from.
    SendString = replicate(SendString,CashDrawerWidth)
endif
serialComm1.WriteString( SendString )

I see in my notes also that in the function writeString( Wstring )
There was a local statement that included Wstring and I had to remove that
localizing of Wstring.
That may be the reason for the Wstring.length throwing an error.
also before sending the string you might want to make sure it is a string
SendString = new string(""+SendString )
serialComm1.WriteString( SendString )
I may have an older version of SerialComm.cc since I never updated it since
I stopped using it like over 10 years ago.

Not sure this helps or that it even pertains to a pole display...
Later on that company switched to a USB cash drawer because most machines
don't have serial ports anymore and they also supplied me with a activeX.
I also use another companies that came with a DLL for communications with
the cash drawler.
The same company also came out with a USB pole display with activeX.
Might be worthwhile to look into a USB or DLL pole display instead of a
serial port display.
Rich...


"Mervyn Bick"  wrote in message news:5JkZesafVHA.1876@ip-AC1E04A7...

On 2019-10-08 12:12 AM, Emeka wrote:
> Thank you Mervyn,
>
> When I clicked the Display text button, It displayed errot of 'variable
> undefined' LENGTH in line 612 and 613 and 'variable undefined' SENDSTR in
> line 616 of serialcomm.cc. Then when I click ignore severally, it will
> display my text on the pole display meaning its opening the port. Please
> how do I correct this error and continue.


The good news is that your computer is at least talking to the pole
display.  Now all it needs to do is to talk sense. :-)

I'm afraid it's probably nearly 20 years since I last used
serialComm.cc. My computer doesn't have a serial port so the little test
form I posted previously was completely untested.  Even if I had a
serial port installed it would be difficult to sort out problems as I
don't have a similar pole display to play with.

serialComm.cc may not accept single characters as a string so my attempt
to send reset and cursorOff messages may be causing the problem.  On the
other hand, I don't recall problems sending single commands to a modem
but that was a long time ago.  Back in the days when I was working I
also had access to a Data Analyser which was a great help in fixing
problems.

I suggest you start by replacing the pushbutton1_onClick() event handler
with the following.


    function PUSHBUTTON1_onClick()
       oS = form.serialcomm1
       oS.openPort('COM1',9600,'n',8,1)
       oS.writeString(form.entryfield1.value)
       oS.writeString(form.entryfield2.value)
       oS.closePort()

If this works type two new messages into the entryfields and see what
happens when you click the pushbuttton.

Mervyn.