Sending Variables!

Now I want to compare the value and the name of any public variable.

Perhaps if you looked at the contents of a hex file that was uploaded to the Arduino, you'd see that this is an impossible task.

Variable names are mapped to addresses in the hex file. The name is not part of the uploaded hex file, so there is no way compare a string to any (non-existent) variable name(s) at run time.

In the code that you have now, you are doing the comparison at compile time, not at run time.