# FEATURE SUGGESTION: Equivalent 'eval' function for strings

**URL:** <https://forum.bome.com/t/feature-suggestion-equivalent-eval-function-for-strings/3998>\
**Category:** Bome Products\
**Created:** [February 18, 2022, 7:00am UTC](https://forum.bome.com/t/feature-suggestion-equivalent-eval-function-for-strings/3998 "2022-02-18T07:00:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwesse](https://forum.bome.com/user_avatar/forum.bome.com/mwesse/32/2566_2.png) [@mwesse](https://forum.bome.com/u/mwesse)\
**Post date:** [February 18, 2022, 7:00am UTC](https://forum.bome.com/t/feature-suggestion-equivalent-eval-function-for-strings/3998/1 "2022-02-18T07:00:14Z")

</div>

Just a thought;’  
It often very efficient to execute the value of a string  
eg lets say there are 2 cases where case 1 will send ‘90 2D 7F’ and case 2 needs to send 3 of the same ie ‘90 2D 7F’ ‘90 2D 7F’ ‘90 2D 7F’  
myVal = caseStr  
Ideally you could composite a string linearly and then simply execute the string ie on the raw midi line  
eval(myVal)

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [February 18, 2022, 1:36pm UTC](https://forum.bome.com/t/feature-suggestion-equivalent-eval-function-for-strings/3998/2 "2022-02-18T13:36:55Z")

</div>

Hi,

OK however you know there are currently no string variables in MT Pro, right? This, along with arrays has also been requested. I think eval would come later.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![mwesse](https://forum.bome.com/user_avatar/forum.bome.com/mwesse/32/2566_2.png) [@mwesse](https://forum.bome.com/u/mwesse)\
**Post date:** [February 18, 2022, 8:17pm UTC](https://forum.bome.com/t/feature-suggestion-equivalent-eval-function-for-strings/3998/4 "2022-02-18T20:17:17Z")

</div>

Yep totally…was more on the back of being able to use the sprint stuff re: goto using int\>str etc  
Arrays would be nice but named globals and then eval would be way more immediate impact and more contextually relevant (to the rules type language) than arrays? ie in priorities imvho  
I havent had the need for arrays yet but of course others may be using it completely differently to me.

Do you have a need for arrays and how might you apply them? Interested 🙂

Eval allows a huge reduction of forking although the change in mindset can be a bit painful

Cheers Steve

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [February 18, 2022, 8:44pm UTC](https://forum.bome.com/t/feature-suggestion-equivalent-eval-function-for-strings/3998/5 "2022-02-18T20:44:24Z")

</div>

Yes, arrays for me would be nice like

fader[0], fader[1] etc (if using user created global variable names)

Even this would be nice

ga[0] = 7  
ga[1] = 3  
…

For instance if these are faders.

Then I wouldn’t need to do this

// default  
rr=-1  
// Put the appropriate global variable into rr  
if pp==1 then rr=g1  
if pp==2 then rr=g2  
if pp==3 then rr=g3  
if rr\<0 then exit rules skip outgoing action

// Now do stuff with rr  
…  
// Now put it back into the global space  
if pp==1 then g1=rr  
if pp==2 then g2=rr  
if pp==3 then g3=rr

A construct like this would be nice (Macro)

rr=g%ga%

Then if if expanded and ga was was a 1, it would expand to  
rr=g1

or if ga was a 2 it would expand to

rr=g2

And then I could put back into global variable space by

g%ga%=rr

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_
