GET SCRIPT "ExtEvent.scz" SELECT RANGE A1..B17 PUT "=removequeues()" into E1 CLEAR AUTOMATIC RECALC PUT "QID: " into D1 PUT "=createqueues(1024,20480)" into E1 SELECT RANGE A1 GET SERVER "2001" as "test" IF validrtserver("test") { Using External functions and GETRTDATA() can create infinite loops since the arrival of data over a queue will cause a recalc. If AUTO RECALC is turned on, then every tick sent by the external functions over the queue will in turn will generate new ticks. Since external functions are always called on recalc this will create an infinite loop. Therefore to avoid an infinite loop, MANUAL RECALC's must be used, otherwise the infinite will not terminate until the external server is REMOVEd. The recalc's can be automated by placing the following into the Sheet script. EXECUTE EVERY 5 SECONDS COMMAND "RECALC" The time is at the users discretion. Also take note that this has been added to the worksheet which corresponds to this demo. } { The infinite loop described above can be created by commenting out the following line. } MANUAL RECALC PUT "Connected to server test" into A1 PUT "=getrtdata(""test.status"")" INTO A2 PUT "=test:math(""add"",4,4)" into A3 PUT "=getrtdata(""math.add"")" into B3 PUT "=rterrtext(A3)" into C3 PUT "=test:math(""sub"",10,5)" into A4 PUT "=getrtdata(""math.sub"")" into B4 PUT "=test:math(""mul"",2,2)" into A5 PUT "=getrtdata(""math.mul"")" into B5 PUT "=test:math(""div"",30,10)" into A6 PUT "=getrtdata(""math.div"")" into B6 PUT "=test:mmath(""add"",4,4)" into A7 PUT "=rterrtext(A7)" into C7 PUT "=test:math(""aadd"",4,4)" into A8 PUT "=rterrtext(A8)" into C8 RECALC { Remove the Server? } NEW MODAL DIALOG BOX AT (-1, -1)(2.5 inch, 1.5 inch) ADD PUSH BUTTON "OK","CANCEL" AT (1.4 inch, .25 inch) + (1 inch, 1 inch) DIALOG CANCEL PUSH BUTTON SELECT CONTROL 1 SCRIPT "REMOVE SERVER ""test""" DIALOG DEFAULT PUSH BUTTON ADD TEXT "REMOVE SERVER test" AT (.2 inch, .25 inch) + (1 inch, 1inch) USE DIALOG BOX ELSE PUT "Could Not Connect to server test" into A1 END IF RECALC