PDA

View Full Version : Newbie - Advise Please



tracking
- 8th June 2005, 11:52
hELLO
Started using PBP with Codedesigner and trying to learn would appreciate help on the following:

What I'm trying to do is:

SerIn2 pinin,16572,200,start,[STR tempStr\12\"#"]
This seems OK

but how do I use whats in the string for example

IF tempStr = "abcd" Then - This will not work
got loop
EndIF


Advise Please

Thank You

Lyn

Bruce
- 9th June 2005, 00:10
You have to test individual elements in your string array.


IF tempStr(0) = "a" then
IF tempStr(1) = "b" then
IF tempStr(2) = "c" then
IF tempStr(3) = "d" Then
goto loop
End If
End If
End IF
End IfUnfortunately, PBP will not test the whole string as a single argument.

You could also use the wait modifier to wait until ASCII characters abcd
arrive, then receive the remainder of your data packet in the array.

SerIn2 pinin,16572,200,start,[WAIT("abcd"), STR tempStr\8\"#"]

tracking
- 9th June 2005, 18:37
Thanks Bruce every bit of knowledge helps

Cheers

Lyn