Hi everybody,
I want to use the same Strings, as simple examples just named
Item1
Item2
Item3
These strings shall be in all cases the exact same character-sequence.
I tried to realise this with macros
I want to use these character-sequences at different places
which means different function-calls and initialisers
some initialisers need the sequence without double-hyphen
Card MessStellenDropDownCard(&myDashboard, DROPDOWN_CARD,"String1","Item1,Item2,Item3");
some need the character-sequences WITH double-hyphen
const char MyNames[][8] = {
"Item1",
"Item2",
"Item3"
};
all character-sequences comma-separated as a SINGLE string
"Item1,Item2,Item3"
each character-sequences with their own double-hyphens " "
const char MyNames[][8] = {
"Item1",
"Item2",
"Item3"
};
#define macro1 Item1
#define macro2 Item2
#define macro3 Item3
How can I use the marcos for both cases
Card MessStellenDropDownCard(&myDashboard, DROPDOWN_CARD,"String1","Item1,Item2,Item3");
This will not work
Card MessStellenDropDownCard(&myDashboard, DROPDOWN_CARD,"String1","macro1,macro2,macro3");
defining the macros as
#define macro1 "Item1"
#define macro2 "Item2"
#define macro3 "Item3"
does not work either
nor does it work to define
#define AllTogether "macro1,macro2,macro3"
Card MessStellenDropDownCard(&myDashboard, DROPDOWN_CARD,"String1",AllTogether);
So are there any advanced tricks with macros to realise this?
best regards Stefan
