Variable Picker
The global variable picker in ARC, which supports various programming languages, is convenient for developers and users. It offers a comprehensive list of all variables presently assigned within the compiler environment. This feature is particularly valuable for managing and manipulating data across different sections of your code.
*Note: Default global variables are set for internal system components of ARC that can be understood by clicking here.
EZ-Script
In the context of EZ-Script, variables are globally accessible and are denoted by a $(dollar sign). This global scope ensures that variables can be shared seamlessly among various controls and scripts within the ARC platform. The versatility of EZ-Script variables allows for efficient communication and coordination between different components of your project.
JavaScript & Python
The ARC environment provides dedicated methods for developers working with JavaScript or Python to interact with global Script variables: getVar(), setVar(), and setVarObject(). These methods enable seamless integration and data exchange between all programming environments and robot skills, enhancing the flexibility and interoperability of your project. setVar() is used to store generic variables globally, such as strings, numbers, and single-dimensional arrays. Where setVarObject() is used to store objects globally, such as multidimensional arrays and other JavaScript objects, other robot skills can use getVar() to obtain the variable's value from the global storage in any robot skill.
Variable Picker
Additionally, the variable picker not only displays the names of variables but also includes their current values. This real-time information is invaluable for debugging and monitoring the state of your program. In the case of arrays, the variable picker goes a step further by presenting the values encapsulated within each array. This level of detail aids developers in gaining insights into the structure and content of complex data structures.
A user-friendly feature of the variable picker is its interactive functionality. Clicking on a variable name within the picker instantly adds the corresponding text to your script editor. This streamlines the coding process, reducing the chances of errors and making it easier to reference and work with variables throughout your codebase.
In summary, the variable picker in ARC is a powerful tool for managing variables across different programming languages. It promotes code clarity, facilitates seamless integration between EZ-Script and external languages like JavaScript or Python, and enhances the overall development experience by providing real-time insights into variable values and structures.