PDA

View Full Version : Searching within array's



timmers
- 6th May 2012, 22:58
I need some help using array's more efficiently. The manual (PBP 2.6) has little information on practical usage of arrays though I have seen a few examples around the forum, but no references.

I am receiving serial data into an array and I need to sort the reply (ASCII) into the different messages. Currently I use lots of IF.. THEN.. statements and am looking for something a little less cumbersome.

Typical messages received:-
OK!
DONE
!ERROR!
0152:00000000
015E:00012345
all terminated with a carriage return.

Any suggestions?
Cheers,
Tim.

mackrackit
- 7th May 2012, 00:45
Have you seen this?
http://www.picbasic.co.uk/forum/showthread.php?t=544

Gusse
- 8th May 2012, 21:10
This might be useful.
http://www.picbasic.co.uk/forum/showthread.php?t=12540&p=83401#post83401

BR,
-Gusse-

timmers
- 9th May 2012, 23:06
That's what I was looking for, cheers. Out of interest, is there any documentation for this?

Gusse
- 10th May 2012, 09:21
That's what I was looking for, cheers.
That's good to hear.


Out of interest, is there any documentation for this?
Not really. Darrel's parser script combines several PBP commands together, in very smart way :)
Script, itself, is quite self-explanatory. You might just need to add several similar scripts in parallel/series to get your work done.

BR,
-Gusse-