When using variables in akaBot Studio, there are one method: "Create from Variable Panel". Let's create a Double type array variable named "var" using each method.
Note: Some terms and screens may differ depending on the version, but the general steps and flow remain the same.
Creating from the Variable Panel
This method allows you to set "Name," "Variable Type," "Scope," and "Default Value."
Steps:
- Click the Variable Panel tab.
- Click on "Activities" and select "Create Variable."
- Enter the variable name "var," and from the drop-down list of variable types, select "Array of [T]." If the desired type is not displayed in the drop-down list, select "Browse for Types..."
- A window to select the array element type will pop up. Click the down arrow to display the drop-down list.
- Double type is not displayed in the drop-down list. In such cases, click "Browse for Types..."
- Enter "Double" in the "Type Name" of the pop-up window and search.
- Select the found Double type by clicking it.
- The variable is created. Let's use the "Assign" activity to confirm.
- Drag and drop the "Original > Assign" activity from the toolbox to the designer panel.
- When you type the first letter of the variable name, the created "var" is displayed as a candidate.
- The Double type value can be assigned as an array.
Note: To output and check the array, use "For Each (Collection's Each Element)" to retrieve the elements and display them in the output panel with "Write Line" or show them in a message box.
Creating from Properties
This method creates variables from the properties of an activity. Some activities have a fixed "Variable Type." Here, we will create a variable from the properties of the "Assign" activity.
Steps:
- Drag and drop the "Original > Assign" activity from the toolbox to the designer panel.
- Create a variable from "To" within the activity (the same operation can be done from "Other > To" in the properties panel). After selecting the "To" input field by clicking, right-click to display the context menu and select "Create Variable." (Alternatively, after selecting the "To" input field by clicking, the same operation can be done using the shortcut key [Ctrl + K].)
- A pop-up displaying "Name:" will appear. Enter the variable name and press the Enter key.
- The variable is created and set in the properties. Clicking the Variable tab allows you to check the created variable. Variables created from the "To" of the "Assign" activity are automatically set as Object type.
- We will change it to a Double type array. Changing to a data type not permitted by the properties will result in an error. Select "Array of [T]" from the variable type drop-down list.
- A window to select the array element type will pop up. Click the down arrow to display the drop-down list.
- Double type is not displayed in the drop-down list. In such cases, click "Browse for Types..."
- Enter "Double" in the "Type Name" of the pop-up window and search.
- The variable type is changed. Let's assign Double type values to the created variable "var" as an array.
- The Double type value can be assigned as an array.
Note: To output and check the array, use "For Each (Collection's Each Element)" to retrieve the elements and display them in the output panel with "Write Line" or show them in a message box.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article