MerlinofMines / EasyCommands

Github Repository for Ingame Scripts built by MerlinofMines. Uses MDK to Deploy to SpaceEngineerse
GNU General Public License v3.0
8 stars 3 forks source link

[Bug] Adding Strings to Lists is incorrect #186

Closed MerlinofMines closed 2 years ago

MerlinofMines commented 2 years ago

Describe the bug Adding a string to a list does not insert the string into the list, but rather prints out the list + string.

To Reproduce

set myList to ['a','b','c']

set myMap to []
set outputText to []

for each myValue in myList
  outputText+=myValue

print outputText

Output: []abc

Expected behavior [a,b,c]

Additional context Add any other context about the problem here.

MerlinofMines commented 2 years ago

Actually, after inspection the behavior, while a little unexpected, is correct. Otherwise Print "My list: " + myList + "\n" wouldn't work as expected.

If you intend to add a string item to a list, you need to wrap it [myString]