×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• 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.

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.

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!