# Question about the array

**URL:** <https://forum.xod.io/t/question-about-the-array/4172>\
**Category:** XOD Programming Questions\
**Created:** [June 28, 2020, 10:06am UTC](https://forum.xod.io/t/question-about-the-array/4172 "2020-06-28T10:06:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![danya](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@danya](https://forum.xod.io/u/danya)\
**Post date:** [June 28, 2020, 10:06am UTC](https://forum.xod.io/t/question-about-the-array/4172/1 "2020-06-28T10:06:02Z")

</div>

Is it possible to somehow make an array not from 1 to 100, but from “A” to “Z”?

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [June 28, 2020, 2:58pm UTC](https://forum.xod.io/t/question-about-the-array/4172/2 "2020-06-28T14:58:29Z")

</div>

A single character is a byte. You can use u8-to-number to force conversion to number, then subtract 65 (byte value of ‘A’), or use map-clip and adjust max values to match size of your nth-input array.  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/8/812413241b4f43047a6fb5faebc504a2304eb293.png)

---

<div class="post-metadata">

**Author:** ![danya](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@danya](https://forum.xod.io/u/danya)\
**Post date:** [June 28, 2020, 5:19pm UTC](https://forum.xod.io/t/question-about-the-array/4172/3 "2020-06-28T17:19:40Z")

</div>

after u8-to-number all the time the value is zero:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/f/fd6ab11239b1b180858f19b707e6bfbc5344c2e4.png)  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/95ad077b6a208f99755076ee1b1f04439b32fef6.png)

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [June 28, 2020, 5:31pm UTC](https://forum.xod.io/t/question-about-the-array/4172/4 "2020-06-28T17:31:33Z")

</div>

Looks like you are using tweak string instead of byte. That will return 0.

---

<div class="post-metadata">

**Author:** ![danya](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@danya](https://forum.xod.io/u/danya)\
**Post date:** [June 28, 2020, 6:07pm UTC](https://forum.xod.io/t/question-about-the-array/4172/5 "2020-06-28T18:07:40Z")

</div>

tweak byte

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/9e169a947e27a717b04ba9ca7a02b71914474712.png)  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/c/c3c2d3a7205609523d229144f2df4327b536a133.jpeg)  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/9f23ab1819cd0ce9bd30b87143d6ae652d7f2e32.png)

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [June 28, 2020, 6:22pm UTC](https://forum.xod.io/t/question-about-the-array/4172/6 "2020-06-28T18:22:51Z")

</div>

When I use simulation:  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/4/42b90ed50a628ea08fd6b49202081247230fa831.png)

2 possibilities:

1. result is different when using Arduinio
2. Debug is not yet active if you are downloading to Arduino board. Have you tried hitting reset button on Arduino after downloading has completed? I have issues that XOD is not ready to start debug when Arduino tries to start it immediately after download. Reset of Arduino after download resolves this issue.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [June 28, 2020, 6:25pm UTC](https://forum.xod.io/t/question-about-the-array/4172/7 "2020-06-28T18:25:29Z")

</div>

I just tried with Arduinio Uno. When debug session didn’t start after download, watch node continued to display “watch” instead of “0”. After Arduino reset, watch node displayed 65.00 just like in simulation.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [June 28, 2020, 6:28pm UTC](https://forum.xod.io/t/question-about-the-array/4172/8 "2020-06-28T18:28:13Z")

</div>

Ah…if I change the tweak node during debug, watch changes to “0” and stays that value no matter what I change tweak to. This would seem to be a bug… Same thing happens with simulation and download to Uno. It only displays correctly if tweak node is set before doing download/simulation.

---

<div class="post-metadata">

**Author:** ![danya](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@danya](https://forum.xod.io/u/danya)\
**Post date:** [June 28, 2020, 6:53pm UTC](https://forum.xod.io/t/question-about-the-array/4172/9 "2020-06-28T18:53:27Z")

</div>

I started debug.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/a/a53192747f37b06e218411c95683568a1246da86.png)  
then i reset.  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/1/1085d2f024a05193c3770173a82161e141f9e663.png)  
value he showed right (at least it showed). then i changed the value to ‘x’ and again shows zero.  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/0/0a5f935ea2254d404eb69c14860a40a0aa3e62be.png)  
I reset it again and he showed me the value that was on ‘b’  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/c/c8a425f812f000165988ff65564ef6f3619764cf.png).

---

<div class="post-metadata">

**Author:** ![danya](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@danya](https://forum.xod.io/u/danya)\
**Post date:** [June 28, 2020, 6:57pm UTC](https://forum.xod.io/t/question-about-the-array/4172/10 "2020-06-28T18:57:55Z")

</div>

as if watch remembered the value at the beginning of the simulation and with any letter shows the value of the first letter (b)

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [June 29, 2020, 4:32am UTC](https://forum.xod.io/t/question-about-the-array/4172/11 "2020-06-29T04:32:38Z")

</div>

I think this problem is the same thing that happened to my previous month.

> [@Char - value change in simulation is 00h](https://forum.xod.io/t/char-value-change-in-simulation-is-00h/4014):
>
> Both in simulation and in debug, the conversion of the char is correct only at the beginning, then when changing the char it goes to 00h. Is this a bug? [image]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [July 29, 2020, 4:36am UTC](https://forum.xod.io/t/question-about-the-array/4172/12 "2020-07-29T04:36:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
