Asked — Edited

Question About Return In Script.

OK, I pretty well understand how to do the goto/label/Return , etc. inside of the same script. but, what if I want to call another script from inside of a script and have it return back to the same position in the first script with a RETURN. could I call up a script with the ControlCommand function and the at the end of the script that I called have a return to the same position in the first script?

I am trying to do a main script that calls the other scripts and then comes back to the main script for the next step. Like a subroutine.

Like saying:

GoSub Return

That is what I am trying to do. It hasn't worked for me so far.

Thanks! . . . . . . I will be patient for an answer. Day1

:D


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

PRO
Synthiam
#1  

Beside the script editor is a list of commands. The command Return() is described as follows:

Quote:

Return() . Return from a Goto() . If you jump to a position of code with a Goto(), the Return statement will allow you to return back to that piece of code following the last Goto() statement. . If you attempt to Return() with an empty stack, nothing will happen. The script will ignore the Return() statement. . Example: Return()

There is no reference to the ControlCommand() function call in the Return() help. The ControlCommand() does not "jump" to another script, it starts another script or what ever you specify. It does not stop the current script.

For example, to start another script you would type


ControlCommand("ScriptName", ScriptStart)

The ScriptStart keyword contains the word start, because the script is being started :)

For examples on the ControlCommand, locate locate Examples folder within ARC under File->Examples .. There you will find scripts that demonstrate how to control other windows using ControlCommand().

#2  

Thanks for answering.

I am trying to get it to RETURN back to the same place in the original script. But, I guess what you are saying is that it can only start the script over by calling it with The ControlCommand function.