Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Replacing string items Post Reply Post New Topic
Author Message
swatts
Groupie
Groupie
Avatar

Joined: 17 Mar 2010
Online Status: Offline
Posts: 83
Quote swatts Replybullet Topic: Replacing string items
    Posted: 31 Mar 2010 at 4:44am
I have an if statement that pulls a value in a field, where it uses a replace statement to replace &'s with blanks. Now, here is the kicker. If the value is "other" then I want to replace "other" with the string in a box that explains what other is.

If not isnull (thisfield) then
replace (thisfield),"&"," ") but if (thisfield) = "other" then still replace "&" with " " but also replace "other" with "this is the other value."
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Apr 2010 at 3:39am
local stringvar a;
if not isnull({thisfield}) then(
  a := {thisfield};
  a := replace(a,"&", " ");
  a := replace (a, "other", {otherfield});
);
a
HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.029 seconds.