×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

format text part in colour

format text part in colour

format text part in colour

(OP)
I am using CR 2016

O ahve some text data allways dhwoung in this layout and in blue font

xxxx yyyy zzz

Whats the best to allways show the xxxx in red and rest in blue

RE: format text part in colour

Are you trying to color the first segment red? Or are you trying to color any segment that equals ‘xxxx’ red?

-LB

RE: format text part in colour

(OP)
sorry should have made much clearer, its the first segment - should always be 4 characters but to be safe upto the first space

RE: format text part in colour

Break the field into two sections by creating two formulas:

//{@firstsegment}:
stringvar array z := split({table.textfield}," ");
z[1]

//{@remaining}:
stringvar array z;
numbervar i;
stringvar y;

for i := 2 to ubound(z) do(
y := y + z[i]+" "
);
y

Drop these into a text box, adding one space between. Then right click->format text and select the first segment and format it to red. Repeat for the other formula in the text box.

-LB

RE: format text part in colour

(OP)
Hello

sorry taken while t get back

The first formula worked and created correct data xxxx

the second formula returned nothing at all

//{@remaining}:
stringvar array z;
numbervar i;
stringvar y;

for i := 2 to ubound(z) do(
y := y + z[i]+" "
);
y

RE: format text part in colour

It worked properly when I tested it, but try defining z again in the second formula:

//{@remaining}:
stringvar array z := split({table.textfield}," ");
numbervar i;
stringvar y;

for i := 2 to ubound(z) do(
y := y + z[i]+" "
);
y

-LB

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close