-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getListItem
and getListItems
don't work with variables
#22
Comments
This error is related to But @index = 0
@index += 1 Using This is very confusing syntax. If you are adding to a number using this syntax, it should increment Work on this issue will focus on refactoring this syntax to do the appropriate thing based on the type of the variable being added to, increment numbers, append to text, and add to an array if it was originally an array. This also brought up the fact that a panic currently looks like something in the code is wrong when this was actually a program error, that is now fixed. Thank you for calling this out! |
This fixes instances where += syntax is used on a number or string. In the case of an integer, +=, -=, *= and /= may be used to modify the variable with a literal or variable using the Calculate action. In the case of a string, we reassign the variable using a text action to append the variable or literal to the end of the original variable. Uninitialized values will be added to using the type of variable that is being added to them. Arrays will continue to create a 'Add to Variable' action to add whatever value to that variable.
Closed by ad1c73b |
@electrikmilk, this issue still exists: @list = list("Device Name", "Device Hostname")
@index = 0
@name = getListItem(list, index)
alert(name) I get a similar panic trying to build this. Full stack trace:
|
getListItem
and getListItems
don't work with variables
We shouldn't try to increment the value if the value type of the argument is a variable. This comes with the disadvantage of having to start counting at 1. This is fixed by cb4343a. |
Functions
getListItem
andgetListItems
don't work with variables, however, the underlying action supports this functionality.Here is some code that produces the error:
Here is the error:
The text was updated successfully, but these errors were encountered: