CreateArray no funciona - Forum

Forum Navigation
You need to log in to create posts and topics.

CreateArray no funciona

Cuando trato de usar la funcion CreateArray como en el ejemplo que aparece en la documentacion me da el siguiente error...

 

CreateArray [colors] red,blue,orange,brown,white

ReferenceError: 'red' no está definido
at $scope.DragWords_pageenter (file:///C:/Users/Seba/Documents/VisualNeoWeb/AprendiendoEnCasa1/AprendiendoEnCasa1_Test/main.js?v=67:36:1)
at Anonymous function (file:///C:/Users/Seba/Documents/VisualNeoWeb/Libraries/js/angular.min.js:169:298)
at completeTask (file:///C:/Users/Seba/Documents/VisualNeoWeb/Libraries/js/angular.min.js:166:15)
at Anonymous function (file:///C:/Users/Seba/Documents/VisualNeoWeb/Libraries/js/angular.min.js:52:1)
ReferenceError: 'red' no está definido
at $scope.DragWords_pageenter (file:///C:/Users/Seba/Documents/VisualNeoWeb/AprendiendoEnCasa1/AprendiendoEnCasa1_Test/main.js?v=67:36:1)
at Anonymous function (file:///C:/Users/Seba/Documents/VisualNeoWeb/Libraries/js/angular.min.js:169:298)
at completeTask (file:///C:/Users/Seba/Documents/VisualNeoWeb/Libraries/js/angular.min.js:166:15)
at Anonymous function (file:///C:/Users/Seba/Documents/VisualNeoWeb/Libraries/js/angular.min.js:52:1)

@sebaschanz

Contrary to what the Command Wizard says, it does not form the command properly if you enter the values separated by commas ... if you enter them one-per-line, the Command Wizard will form the command like so ...

CreateArray [colors] "red,blue,orange,brown,white"

... and you can verify it with the following ...

SetVar [firstColor] [colors(0)]
AlertBox "firstColor" "[firstColor]" ""

You can also create the same array like so ...

SetVar "[colorsString]" "red,blue,orange,brown,white"
StrParse "[colorsString]" "," [colors]

 

CN_Iceman has reacted to this post.
CN_Iceman