Asked — Edited

Command Control

In the quick reference, I see that CC accepts two or more arguments.

I've looked through the documentation and the example scripts and I don't see info on using extra parameters with CC.

Parameter 0 - window name Parameter 1 - command Parameter 2 - ? Parameter 3 - ?

Am I missing something?


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  

Only some controls accept multiple parameters. The EZ-Script manual for the ControlCommand displays a few examples - here is a cut and paste from the EZ-Script manual:

Quote:

ControlCommand( windowName, ControlCommandParameter, [values]) Sends a command to the window by its name. Look further down in this document for available ControlCommand() parameters under the ControlCommand Parameter section. This command has a shorthand alias which is "CC" (See examples below). Example: ControlCommand( "ADC Graph", pauseOn ) Example: ControlCommand( "SoundBoard", Track_3 ) Example: ControlCommand( "Camera", CameraTweet, "This is an Image Description" ) Example: ControlCommand( "Script Manager", ScriptStart, "MyScript" ) Example: ControlCommand( "Speech Recognition", PauseMS, 3000) Example: cc("Auto Position", AutoPositionAction, "Action Name") Example: cc("Auto Position", AutoPositionFrame, "Frame Name") Example: cc("Auto Position", AutoPositionFrame, "Frame Name", 50, 3) Example: cc("Speech Recognition", PauseMS, 2000)

The additional parameters for controls that support them are not fully documented at this time. There are some changes being done to the documentation to reflect a pile of updates - including alphabetically sorting the examples. That will be updated in a few releases forward:)

#2  

Okay cool.

If I create my own procedure though, how do I pass parameters to it?

Didn't see that in the manual.

Also, how does scoping of variables work?

PRO
Synthiam
#4  

I should also add that the ControlCommand parameters are hardcoded within the application. You do not pass variables to an EZ-Script. Instead, the variable scope is global - so you use a variable to specify the parameters, then ScriptStart the control.

There are plenty examples within the Examples button within ARC.:)

#5  

Another question about ControlCommand.

Can I pass a label location as an agrument?

i.e. CC("DoingSomething",scriptstart,turnleft)

where the script to run looks something like:

#DoingSomething script :turnleft servo(d13,75) return

:turnright servo(d13,25) return

PRO
Synthiam
#6  

No, you can do the commands that are outlined in the Cheat Sheet tab when editing scripts.

Press Cheat Sheet tab and you can view all available control commands for all controls currently in your project:)

#7  

DJ THAT script he made looks good to add to EZB ,can it be done and others like too.