Ttelmah
Joined: 11 Mar 2010 Posts: 19803
|
|
Posted: Thu Mar 08, 2012 5:36 am |
|
|
dorinm wrote: | you need an evaluator ...
tx_msg[2]=("P" + profile + "M1") ..mainly, to concatenate " "P" + profile + "M1" " into a string (a lot of mcu cycles!) , then evaluate the expression and compare to your defines ... basically it can be done, but would you waste so many mcu cycles? |
No....
Think about it. tx_msg[2], can take a _character_, not a string.
He seemed to want to build a 'variable name' from a string plus the contents of a variable, and then access the character in the variable with this name.
Not possible, unless you build your own table of names, and search in this with string compare functions.
Variable names, don't even exist in the running code.
Best Wishes |
|