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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula explanation

Status
Not open for further replies.

dinshak

Technical User
Oct 31, 2007
39
US
Can someone please explain me the formula below

Global BactId as String
dim numBactId as Number
dim lenBactId as Number
lenBactId = 0
numBactId = {RESULT.REPLICATE_COUNT}


if ({RESULT.FORMATTED_ENTRY} = "Not Applicable") then
if (numBactID = 0) then
BactId = "Not Applicable"
Formula = BactId
end if
elseif ({RESULT.FORMATTED_ENTRY} <> "Not Applicable") then
if (numBactId <= 1) then
BactId = ""
BactId = {RESULT.FORMATTED_ENTRY}
elseif (numBactId > 1) then
BactId = BactId + "/" + {RESULT.FORMATTED_ENTRY}
end if
Formula = BactId
end if
 
This is not a crystal formula.

There is no need for end if

It is setting values for variables

Formula and BactID
Does it work in Crystal

In Crystal it would normally look like this


Global Stringvar BactId;
global numbervar numBactId;
global numbervar lenBactId;
lenBactId:= 0;
numBactId:= {RESULT.REPLICATE_COUNT};


if ({RESULT.FORMATTED_ENTRY} = "Not Applicable") then
if (numBactID = 0) then
BactId:= "Not Applicable";
Formula:= BactId

if ({RESULT.FORMATTED_ENTRY} <> "Not Applicable") then
if (numBactId <= 1) then

BactId:= {RESULT.FORMATTED_ENTRY}
else if (numBactId > 1) then
BactId:= BactId + "/" + {RESULT.FORMATTED_ENTRY};

Formula:= BactId;

Ian
 
Ian,

Crystal allows the use of VB syntax. This formula should work fine.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top