Stream All The Video Sources icon Stream All The Video Sources Stream video from any URI/protocol (RTMP, RTSP, HTTP, UDP, etc.) to a selected ARC camera device for real-time network feed playback. Try it →
Australia
Asked

How Do I Assign A List Of Values To An Array Using Script Language

How do I assign a list of values to an array using the script language in Synthiam ARC? For example, I want to create an array like this: $MyArray = ["value1", "value2", "value3"].



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skills (view all robot skills)
Manage and execute multiple scripts in a single Script Manager using ControlCommand(), with Control Details showing available commands.
Adds GetLineContainingFromArray() ez-script function to return the first array item that contains specified text, simplifying substring searches.

ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

To assign a list of values to an array using the script language in Synthiam ARC, you can use the defineArray() function. Below are the steps and an example of how to do this in JavaScript or Python, which are the preferred scripting languages in ARC.

Steps:

  1. Add the Script Skill: Ensure you have the Script Collection skill added to your project.
  2. Open the Script Editor: Open the script editor for the Script Collection skill.
  3. Define the Array: Use the defineArray() function to create and assign values to the array.

Example in JavaScript:

// Define an array with specific values
var myArray = ["value1", "value2", "value3"];

// Print the array to verify
print(myArray);

Example in Python:

# Define an array with specific values
myArray = ["value1", "value2", "value3"]

# Print the array to verify
print(myArray)

Using defineArray() in EZ-Script:

If you prefer to use EZ-Script, you can use the defineArray() function as follows:

# Define an array with specific values
defineArray($MyArray, 3, "value1", "value2", "value3")

# Print the array to verify
print($MyArray)

Using the Get Line Containing From Array Skill:

If you want to use the Get Line Containing From Array skill, you can follow these steps:

  1. Add the Get Line Containing From Array Skill: Ensure this skill is added to your project.
  2. Use the Skill in a Script: Use the skill within a script to manipulate arrays.

Example Using Get Line Containing From Array in EZ-Script:

# Define an array with specific values
defineArray($MyArray, 3, "value1", "value2", "value3")

# Use the Get Line Containing From Array function
$line = GetLineContainingFromArray($MyArray, "value2")

# Print the result
print($line)

Resources:

Feel free to ask if you have any more questions or need further assistance!

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.
Author Avatar
PRO
Canada
Twitter YouTube GitHub
#2  

To assign a list of values to an array using the script language in Synthiam ARC, you can use the defineArray() function. Below are the steps and an example of how to do this in JavaScript or Python, which are the preferred scripting languages in ARC.

Steps:

  1. Add the Script Skill: Ensure you have the Script Collection skill added to your project.
  2. Open the Script Editor: Open the script editor for the Script Collection skill.
  3. Define the Array: Use the defineArray() function to create and assign values to the array.

Example in JavaScript:

// Define an array with values
var myArray = ["value1", "value2", "value3"];

// Print the array to verify
print(myArray);

Example in Python:

# Define an array with values
myArray = ["value1", "value2", "value3"]

# Print the array to verify
print(myArray)

Using defineArray() in EZ-Script:

If you prefer to use EZ-Script, you can use the defineArray() function as follows:

# Define an array with values
defineArray($MyArray, 3, "value1", "value2", "value3")

# Print the array to verify
print($MyArray)

Using the Get Line Containing From Array Skill:

If you want to use the Get Line Containing From Array skill, you can follow these steps:

  1. Add the Get Line Containing From Array Skill: Ensure this skill is added to your project.
  2. Use the Skill in a Script: Use the skill within a script to manipulate arrays.

Example Using Get Line Containing From Array in EZ-Script:

# Define an array with values
defineArray($MyArray, 3, "value1", "value2", "value3")

# Use the Get Line Containing From Array function
$line = GetLineContainingFromArray($MyArray, "value2")

# Print the result
print($line)

Resources:

Feel free to ask if you have any more questions or need further assistance!

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.