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

How to use IF with shared command

Status
Not open for further replies.

redeemasp

Programmer
Jun 1, 2004
63
GB
Hi there

How do you define shared variables with BASIC (not Crystal)SYNTAX,

I'm coding using it:

If Left ({Command.RRE_Code},1) = 'J'
then
shared stringvar shdvarJCode = 'J';
shared currencyvar shdvarJSellingPrice := Sum ({@Selling Price}, {Command.RRE_Code});
shared currencyvar shdvarJNetSellingPrice := Sum ({@Selling Discount}, {Command.RRE_Code});
shared stringvar shdvarJdept := 'Employee Research';

 
Most don't use Basic, so you're limiting your resources by using it.

Try CR syntax using:

whileprintingrecords;
shared stringvar shdvarJCode := "";
shared currencyvar shdvarJSellingPrice := 0;
shared currencyvar shdvarJNetSellingPrice := 0;
shared stringvar shdvarJdept := ""
If Left ({Command.RRE_Code},1) = 'J'
then
shared stringvar shdvarJCode := 'J';
shared currencyvar shdvarJSellingPrice := Sum ({@Selling Price}, {Command.RRE_Code});
shared currencyvar shdvarJNetSellingPrice := Sum ({@Selling Discount}, {Command.RRE_Code});
shared stringvar shdvarJdept := 'Employee Research';

Note that needing all of this code depends upon where you're using it and why.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top