• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Help appending a text with a period variable to another variable. (rfb)

I need to append a peice of text with periods in it to the IDC_VAR variable.
if IDC_VAR ends up being    
"My house is"      {without the " quotes }

I want to append
"big. Wow!"        {without the " quotes }
to the end (just an example)

Original
varName.replaceBuf(rfb::strDup(rfb::CStr(getItemString(IDC_VAR))));

One of my non-working versions
varName.replaceBuf(rfb::strDup(rfb::CStr((getItemString(IDC_VAR))+"big.")));

Another of my non-working versions
char* duh = "big.";
varName.replaceBuf(rfb::strDup(rfb::CStr((getItemString(IDC_VAR))+duh)));

I dont think the + is going to work for a text variable.
Thanks guys.  (of course it doesnt have to be 'house'  ;)
0
HypercubeTech
Asked:
HypercubeTech
1 Solution
 
beryl666Commented:
i don't understand what you mean? is it in c++? why don't you use copy both text into string type then use string to append or + together then write it back to original place? is it easier?
0
 
HypercubeTechAuthor Commented:
it is c++
i need to append  some text to the end of IDC_VAR with some punctuation
lets say IDC_VAR =    "Programming is"
 
i need this string
varName.replaceBuf(rfb::strDup(rfb::CStr(getItemString(IDC_VAR))));
to equal   "Programming is fun."
its really just   CStr(getItemString(IDC_VAR));  
somehow i need to add some actual text to the value of IDC_VAR

thanks again
0
 
HypercubeTechAuthor Commented:
Figured it out...

varName.replaceBuf(rfb::strDup(rfb::CStr(getItemString(IDC_VAR))));
strcat(varName.buf,"text with a period. See!");


Much simpler than I thought..
Thanks for the help..

0
 
waysideCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ - Refund

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

wayside
EE Cleanup Volunteer
0
 
Computer101Commented:
PAQed with points refunded (125)

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now