# on start, B pends on FX0
# when scr A sets to 1, B runs

# wait for script A
println "\r\nB waiting for A"

:waitA
if [  ! FX0  ] goto waitA

# do something...
println "B running..."
println "B activities..."

# reset FX0
println "B resetting FX0"
freg FX0=0

# notify script A 
println "B done, notifying A"
freg FX1=1

# using using variable
# as return value
set var S0 waitA
println "B waiting for A"
goto $S0

end

