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

WHy always false 3

Status
Not open for further replies.

thysonj

Programmer
Jul 6, 2001
240
US
I am new to CR and I am having problems doing even simple things with formulas.
If I put a formula like this in it always resolves to false when I previen the report. What am I doing wrong?

Code:
StringVar Name;
Name = {spGetGroupReportData4;1.GroupMemberID_fk}

This is simplified even from the if-else statment i was running and even this doesn't do anything except give me false.
 
use a :=, not an =, to assign a value to a variable in Crystal Syntax.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
dgillz is right....

in Crystal language
:= is assignment equals
= is comparison equals

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
I knew it was something totally stupid...thanks
 
hahaha...not stupid...it just takes a while to get used to Crystal syntax...there are more "stupid" things that you will have to learn....

for example with respect to IF_Then blocks study this syntax

If {Table.value} = "something" then
(
{Table.number} := 9;
{Table.string} := "A";
)
else
{Table.string} := "B";

things to note:

1. the final ";" after "B" is like a VB "end IF" showing the end of the If_then block.
2. If you have more than 1 statement in the block you must use brackets to keep them together
3. the result of each section of the If_then block must be of the same datatype

for example this construction will NOT work

If {Table.value} = "something" then
(
{Table.string} := "A";
{Table.number} := 9; //this is numeric
)
else
{Table.string} := "B"; // this is a string

So you have many so-called "stupid" things to learn...hahaha... we all have learned them.

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top