Is there a way to reference one variable with another? Preferably by name.

Sorry to be late to the party. May I suggest a different possibility? This sounds like a potential application for Bitlash, specifically a tweaked version of the bitlashsd example.

I see a couple approaches:

  1. If you can tolerate your message files on the sd card looking like (well, being) bitlash code:
print "Temperature is:", getTemperature();
print "Pressure is:", getPressure();
...

...it might be (well, it would be) easier to integrate your existing sensor and display code into the Bitlashsd example (as user functions) than write your proposed parser. Then you have a general display engine you can program with files on the SD card. Bitlash is at http://bitlash.net and you can see the sd card example here: bitlash/bitlashsd.pde at master · billroy/bitlash · GitHub

  1. On the other hand you may really want plain text files with only the code escaped in []. The Bitlash web server example does this; you can embed code in [] in PROGMEM web page templates for execution at page rendering time. You could steal that code and use it in your parser to pick out bits of Bitlash to execute and embed using user functions like #1.

Make any sense? Happy to help with questions and complications.

-br