Return statement in function called from WAIT command
dk_akj
Posts: 37
This funktion wait for the word "Status", if not Status arrives within 4000 * 400 microseceonds the function invalid_msg is "called".
My question:
Where does the Return statement in line 7 return to (linenumber) ??
1: check_status:
2:· SERIN 14, BaudRate,Bad_Data,4000,invalid_msg , [noparse][[/noparse]WAIT("Status" ), STR SMSmsg\8 ]
3:· DEBUG "Status arrived !!",CR,LF·
4:
5: invalid_msg:
6:·· DEBUG "Invalid data !!",CR,LF
7:·· RETURN
8:
9:
10: Bad_Data:
11:· DEBUG· "Parity error",CR,LF
12:· RETURN
//Akj
My question:
Where does the Return statement in line 7 return to (linenumber) ??
1: check_status:
2:· SERIN 14, BaudRate,Bad_Data,4000,invalid_msg , [noparse][[/noparse]WAIT("Status" ), STR SMSmsg\8 ]
3:· DEBUG "Status arrived !!",CR,LF·
4:
5: invalid_msg:
6:·· DEBUG "Invalid data !!",CR,LF
7:·· RETURN
8:
9:
10: Bad_Data:
11:· DEBUG· "Parity error",CR,LF
12:· RETURN
//Akj
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Like this ?
1: check_status:
2: SERIN 14, BaudRate,Bad_Data,4000,invalid_msg , [noparse][[/noparse]WAIT("Status" ), STR SMSmsg\8 ]
3: DEBUG "Status arrived !!",CR,LF
4:
5: invalid_msg:
6: DEBUG "Invalid data !!",CR,LF
7: goto somewhere
8:
9:
10: Bad_Data:
11: DEBUG "Parity error",CR,LF
12: goto somewhereelse
Thanks alot for the fast answer.
//Akj - from Denmark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office