javascript problem..(Read 15441 times)
javascript problem.. on: November 27, 2007, 09:14:06 PM
Hi ..

I'm working with serial port activex control and the problem is:

When I try to send for example: 41 10 23 28 00 0B 57 00 
with a function called writestr
and due to the fact that in javascript all strings are zero-terminated, javascript
considered the fifth byte (00) to be an end of the string and cut off the rest of it.
The same occurs with readstr

I don't know if vbscript has the same problem...

I would like to know if you product can help me with this situation...


Thanks
Manuel Cota.
Best Regards....



Re: javascript problem.. Reply #1 on: November 28, 2007, 10:36:21 AM
Serial Port ActiveX Control can also offer Read/Write and ReadArray/WriteArray functions. Those will not treat the zero character as the end of the string, like ReadStr and WriteStr do.



Re: javascript problem.. Reply #2 on: November 28, 2007, 06:19:13 PM

hi janna.. thanks for you response..

do these functions work in javascript??

I don't see some function called  ReadArray/WriteArray only ReadVariant/WriteVariant
I imagine that it is almost the same thing...

This is a part of a response that I found in the old forums:

javascript doesn't allow to allocate memory
programmatically. That's why neither Read() nor ReadVariant() methods will work (javascript doesn't work
with OLE variants as well). Thus ReadStr() is the only valid method in javascript.


could you show me some a little example of these functions in JavaScript?

thanks
manuel...






Re: javascript problem.. Reply #3 on: December 05, 2007, 06:09:54 PM
 ??? ??? ??? ??? ??? ??? ???



Re: javascript problem.. Reply #4 on: December 06, 2007, 12:02:20 PM
Sorry for the delay with reply.

I am afraid we cannot help you much here, you should refer to javascript documentation. As far as we know ReadArray/WriteArray commands are not for JavaScript but for Java. I confirm the statement concerning Read and ReadVariant methods. So, it seems JavaScript is not the best environment for you.

We would recommend you using VBScript which can perfectly well work with Read() and ReadVariant().






 

Sitemap 1 2 3 4 5