Click here to Skip to main content
14,580,263 members

C / C++ / MFC

 
QuestionRe: i really need help with this Pin
David Crow29-Mar-19 9:24
MemberDavid Crow29-Mar-19 9:24 
AnswerRe: i really need help with this Pin
Member 1420332730-Mar-19 3:52
MemberMember 1420332730-Mar-19 3:52 
GeneralRe: i really need help with this Pin
k505430-Mar-19 4:48
mvek505430-Mar-19 4:48 
GeneralRe: i really need help with this Pin
Member 142033272-Apr-19 4:13
MemberMember 142033272-Apr-19 4:13 
SuggestionRe: i really need help with this Pin
David Crow30-Mar-19 5:33
MemberDavid Crow30-Mar-19 5:33 
AnswerRe: i really need help with this Pin
Gerry Schmitz29-Mar-19 10:40
mveGerry Schmitz29-Mar-19 10:40 
AnswerRe: i really need help with this Pin
Vaclav_1-Apr-19 15:43
MemberVaclav_1-Apr-19 15:43 
QuestionPutting declared const into a print statement Pin
SEmmett28-Mar-19 10:45
MemberSEmmett28-Mar-19 10:45 
So, I have this snippet of code that formats an html table data cell:
if(aSensor[i].sensorSwitchState == lowState) {
 client->print("<td style='width:30px; background-color:lawngreen'>");
} else {
 client->print("<td style='width:30px; background-color:red'>"); //
}

I have each background-color:<colorname> hardcoded and the subsequent printing output is as I was expecting. However, I would like to replace the <colorname> entry - lawngreen and/or red - with a const (or #define) so that the <colorname> entry is replaced with the color name.

I've tried
#define GREEN lawngreen
...
client->print("<td style='width:30px; background-color:GREEN'>")

and that doesn't work.

I've tried
const char acolor[]="lawngreen";
client->print("<td style='width:30px; background-color:acolor'>")

and that doesn't work.

I know there has to be a way to do this, but I can't seem to figure it out. Any ideas how I go about making a declaration that will let me insert the <color name=""> in the appropriate place would be greatly appreciated.

TNX
AnswerRe: Putting declared const into a print statement Pin
k505428-Mar-19 11:01
mvek505428-Mar-19 11:01 
AnswerRe: Putting declared const into a print statement Pin
CPallini28-Mar-19 11:06
mveCPallini28-Mar-19 11:06 
GeneralRe: Putting declared const into a print statement Pin
SEmmett28-Mar-19 11:34
MemberSEmmett28-Mar-19 11:34 
GeneralRe: Putting declared const into a print statement Pin
k505428-Mar-19 12:01
mvek505428-Mar-19 12:01 
GeneralRe: Putting declared const into a print statement Pin
SEmmett28-Mar-19 14:53
MemberSEmmett28-Mar-19 14:53 
QuestionHow i get any scan image source library ? Pin
ahmed_sa26-Mar-19 23:20
Memberahmed_sa26-Mar-19 23:20 
AnswerRe: How i get any scan image source library ? Pin
Richard MacCutchan26-Mar-19 23:49
mveRichard MacCutchan26-Mar-19 23:49 
QuestionI am trying to make a keyboard recorder for an app Pin
Member 1419098121-Mar-19 2:09
MemberMember 1419098121-Mar-19 2:09 
AnswerRe: I am trying to make a keyboard recorder for an app Pin
Eddy Vluggen21-Mar-19 2:18
professionalEddy Vluggen21-Mar-19 2:18 
GeneralRe: I am trying to make a keyboard recorder for an app Pin
Member 1419098122-Mar-19 2:15
MemberMember 1419098122-Mar-19 2:15 
GeneralRe: I am trying to make a keyboard recorder for an app Pin
Richard MacCutchan22-Mar-19 4:23
mveRichard MacCutchan22-Mar-19 4:23 
GeneralRe: I am trying to make a keyboard recorder for an app Pin
leon de boer24-Mar-19 6:54
Memberleon de boer24-Mar-19 6:54 
GeneralRe: I am trying to make a keyboard recorder for an app Pin
Stefan_Lang24-Mar-19 22:25
mveStefan_Lang24-Mar-19 22:25 
AnswerRe: I am trying to make a keyboard recorder for an app Pin
jschell23-Mar-19 5:37
Memberjschell23-Mar-19 5:37 
GeneralRe: I am trying to make a keyboard recorder for an app Pin
Member 1419098127-Mar-19 2:02
MemberMember 1419098127-Mar-19 2:02 
QuestionDot Net Version Pin
JM225119-Mar-19 20:44
MemberJM225119-Mar-19 20:44 
GeneralRe: Dot Net Version Pin
David Crow20-Mar-19 4:09
MemberDavid Crow20-Mar-19 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.