PDA

View Full Version : STR \ Coun max len?



pedja089
- 7th December 2013, 08:12
Hi,
Is there way to make count for STR to be larger than 1 byte. As far as I can see in pbppic18.lib it uses only one byte for countdown. I can make 2 byte counter, but I can't find where is stored high byte of count.
I need to receive 700 bytes in array...
I'll try to solve it with FOR/NEXT...

Demon
- 8th December 2013, 01:54
Could you receive two blocks of 256 bytes and then one block of 188 bytes?

Robert

pedja089
- 8th December 2013, 19:53
No.
Because I need one continues string. It work with FOR...
Compiler passes only low byte of count to R4.Byte1(system var). It would be nice to have some warning when compiler do that.
So it isn't just some change in lib files, it would require changes to compiler. Probably isn't worth doing that...
But when using 18F parts that have over 3K of RAM, and compiler all ready support arrays longer 255 byte, it would be nice to use STR same way for all arrays, independent of their size...

Darrel Taylor
- 9th December 2013, 05:20
Receive 700 bytes into a single array using STR.

MyArray VAR BYTE[700]

HSERIN [WAIT("!"), STR MyArray\200, STR MyArray(200)\200, _
STR MyArray(400)\200, STR MyArray(600)\100]

pedja089
- 9th December 2013, 07:30
Thanks, Darrel.