Jump to content
357mag

My carriage return and line feed isn't working

Recommended Posts

I need to print these lines on separate lines. So each output is on a new line. Don't know where I'm going wrong but right now it's doing this:

 

The value of count is 0The value of total is 5

 

My code is this:

 

int count;
int total;

	count = 5;
	total = 0;

	EditResults -> Text = EditResults -> Text + "The value of count is " + IntToStr(count) + "\r\n";
	EditResults -> Text = EditResults -> Text + "The value of total is " + IntToStr(total);
   //	total = ++count + 6;
   //	EditResults -> Text = EditResults -> Text + "\r\nThe value of count is " + count;
   //	EditResults -> Text = EditResults -> Text + "\r\nThe value of total is " + total;

 

I've commented out the last three lines until I figure out what's wrong. I'm using an Edit box and I looked for a multi-line property but none is listed. 

Edited by 357mag

Share this post


Link to post

So I got rid of the Edit box and replaced it with a Memo box and now my program is printing on different lines. But it also says MemoResults in the box, so how do I get rid of that? I'm looking in Properties for a Text or Caption property and I don't see them.

Share this post


Link to post

My program runs correctly now, but for some odd reason when I hit Run in the Memo box the words (what I used to name the Memo control) say "MemoResults". How do I get rid of those words? I don't want those words in there.

Share this post


Link to post

Add MemoResults -> Clear() at the beginning of your code.

 

I recommend looking up the online help for the VCL components to learn about their capabilities.

Share this post


Link to post

Ha! I got it figured out!

 

You have to go into Lines and then delete those words in the String List Editor.

 

Works good now.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×