At various sections of my main procedure I use a WHEN TARGET check to CALL a sub procedure to perform certain tasks based on responses I recieve. It seems that the main procedure continues to run in parallel to the sub procedure being called. I though that the main procedure would pause until the sub procedure was complete.
To test this I made something like this. I transmits 'NEW' in this case and I know the responce will be 'TYPE'. I did this to test the WHEN TARGET CALL.
proc main
transmit "new^m"
when target 0 "type" call subproc
mspause 100
usermsg "main procedure"
endproc
proc subproc
mspause 400
usermsg "sub procedure"
endproc
What I get is a "main procedure" message first, followed by a "sub procedure" message, and then a second "main procedure" message. Is the script actually running in two places at once in this case? What I want to happen is that the main procedure pauses or suspends until the sub procedure is complete.
Any help would be appreciated.
To test this I made something like this. I transmits 'NEW' in this case and I know the responce will be 'TYPE'. I did this to test the WHEN TARGET CALL.
proc main
transmit "new^m"
when target 0 "type" call subproc
mspause 100
usermsg "main procedure"
endproc
proc subproc
mspause 400
usermsg "sub procedure"
endproc
What I get is a "main procedure" message first, followed by a "sub procedure" message, and then a second "main procedure" message. Is the script actually running in two places at once in this case? What I want to happen is that the main procedure pauses or suspends until the sub procedure is complete.
Any help would be appreciated.