# How can I use in Manipulate an array of integers as an input?

**URL:** <https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165>\
**Category:** Questions\
**Tags:** interface-construction\
**Created:** [June 7, 2020, 6:37pm UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165 "2020-06-07T18:37:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![francescolasco](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@francescolasco](https://community.wolfram.com/u/francescolasco)\
**Post date:** [June 7, 2020, 6:37pm UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165/1 "2020-06-07T18:37:28Z")

</div>

I want to use a list of integers in something like this:

```
Manipulate[
 Sum[i, {i, l}],
 {l}
 ]

```

Whithout having to use the brackets in the input field, i’d like to use 1,2,3 instead of {1,2,3}.  
Is that possible?

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [June 7, 2020, 6:50pm UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165/2 "2020-06-07T18:50:31Z")

</div>

Hi Francesco,

Can you please clarify your question. There is no `{1, 2, 3}` in the posted code so it is not clear what exactly you are trying to replace.

---

<div class="post-metadata">

**Author:** ![mikebesso](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mikebesso/32/22282_2.png) [@mikebesso](https://community.wolfram.com/u/mikebesso)\
**Post date:** [June 7, 2020, 8:03pm UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165/3 "2020-06-07T20:03:30Z")

</div>

I’m taking a guess that you want to pass separate scalars to a function instead of putting those scalars into a list.

The Wolfram has the concept of [sequences](http://reference.wolframcloud.com/language/ref/Sequence.html) which can help. And fortunately, it is easy to switch between sequences and lists. For example, if I define a function as:

```
f[x : ___] := List[x];
f[x_List] := x;

```

Then, I can call this function with either:

```
f[1, 2, 3];
f[{1, 2, 3}];

```

And get the same result: {1, 2, 3}

If this isn’t what you are talking about, please provide some more info.

THANKS

---

<div class="post-metadata">

**Author:** ![francescolasco](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@francescolasco](https://community.wolfram.com/u/francescolasco)\
**Post date:** [June 8, 2020, 9:24am UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165/4 "2020-06-08T09:24:06Z")

</div>

Hi Rohit,

I’d like to use `1,2,3` instead of `{1,2,3}` in the input field below.

 ![Screenshotfrom2020-06-0811-20-12.png](https://global.discourse-cdn.com/wolfram/original/3X/b/4/b48d90c630ff8b17bb4cddd44ab0722dbd1ba8eb.png)

---

<div class="post-metadata">

**Author:** ![francescolasco](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@francescolasco](https://community.wolfram.com/u/francescolasco)\
**Post date:** [June 8, 2020, 10:39am UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165/5 "2020-06-08T10:39:25Z")

</div>

Thanks Mike,  
That’s more or less what i’d like to do, but this behavior does not seem to transpose well into Manipulate expressions.. Or at least i did not manage to make it work.

Let’s say we want to use a sequence in this Manipulate object, and use `1,2,3` as an input instead of `{1,2,3}`. How could we do it?

 ![Screenshotfrom2020-06-0811-20-12.png](https://global.discourse-cdn.com/wolfram/original/3X/b/4/b48d90c630ff8b17bb4cddd44ab0722dbd1ba8eb.png)

---

<div class="post-metadata">

**Author:** ![mikebesso](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mikebesso/32/22282_2.png) [@mikebesso](https://community.wolfram.com/u/mikebesso)\
**Post date:** [June 8, 2020, 1:11pm UTC](https://community.wolfram.com/t/how-can-i-use-in-manipulate-an-array-of-integers-as-an-input/16165/6 "2020-06-08T13:11:39Z")

</div>

I suggest letting your input be a string. Then you can use [Evaluate](https://reference.wolfram.com/language/ref/Evaluate.html) as follows:

```
input = "1, 2, 3";
Evaluate["{" <> input <> "}"]

```

This returns the list:

```
{1, 2, 3}

```
