PDA

View Full Version : Does anyone know how to......



gringobomba14
- 26th July 2008, 14:29
I have a string, call it INPUT, and it is 16 chars long. how to I check the FIRST or LAST char? What I would like to do is something like:

if (input<<1) <> "*" then goto FAILURE

But that obviousley isn't how to do it.

HELP!!!!!!!!!!

mackrackit
- 26th July 2008, 15:03
Move the string into an array then you can check any of the array elements.


SERIN2 PORTB.5,24972,[WAIT("A"),STR NUMS\16]
IF NUMS[0] = ??? then ...

gringobomba14
- 26th July 2008, 15:06
But it worked. That was staring me in the face. Cheers Dave, and thanks

circuitpro
- 9th December 2008, 18:52
I've been away from PBP for a couple of years, and a lot of 'STR' stuff is new to me. I always see STR arrays being loaded from the serial port. Here's my dumb question...

Is there a way to quickly load a STR array manually, i.e.

ARRY var BYTE[10]

ARRY = "Testing"

or something similar, or must we do it like:

ARRY[0] = "T"
ARRY[1] = "e"
etc.
etc.

skimask
- 9th December 2008, 20:51
Do a search for copystring, one of those 2 threads is right...well, the first few posts of it anyways should give you a few ideas.

circuitpro
- 10th December 2008, 06:20
That's very cool! Thanks. :)