Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I code a hard carriage return in an IF-Else? 2

Status
Not open for further replies.

majordog

Programmer
Jul 8, 2002
222
CA
Hello,
I have a formula field which contains an If-Else Statement. For example:
IF {} = 1 THEN
"CO" ....I would like to place a carriage return
here, In VB it would be _ Does this exist in
Crystal 8.5?
& {}

Hope someone can help me,
Thanks S
 
Hi !

Try this:

IF {} = 1 THEN
"CO" + chr(13) + {}


/Goran
 
Your post is not too clear. If you want to have more than one statement executed for the 'TRUE' part of the condition then use:

if <condition> then
(
Statement1;
Statement2;
Statement3 )
else
StatementA;

Notice how you need to use brackets to surrounds more than one statement. If you left the brackets off, only the first statement gets executed as part of the IF condition.

If you want to include a <CR> in the outputted text of the formula then use:

If <condition> then
&quot;Some Text&quot; + chr(13)
else
&quot;Some other text&quot;;

Lastly, if you just want to continue a line onto another line, you can use the underscore character as follows:

Text1 := &quot;This is quite &quot; & _
&quot;a long line&quot;;

Hope one of these answers your question
Steve Phillips, Crystal Consultant
 
Yup! I was looking for the Chr(13). But the additional information provided by you, Steve, was good to know as well. Thanks guys!
S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top