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

Error in CR8.5 fornula but not in CR8 formula 1

Status
Not open for further replies.

Joebait

Programmer
Jun 3, 2003
5
US
Hi,

I need some help.

I have a report written in CR8 using a VB6 application. When one of our clients run the report
using cr8.5 he is getting the following error.


Error in formula <column5>
'//*********************************************************************************//'
the ) is missing


Below is the code in formula column5.
This works fine using CR8. I can't find anything wrong with the code. We don't have
CR8.5 so I can't test it to see what the problem is.

Any help will be greatly appreciated
Thank for your help

JoeBait

//**********************************************************************************//
//
// This field displays the data for the field chosen for this column...
//
//***********************************************************************************//
Stringvar sCol5Temp;
Stringvar sUnitPrice := TrimLeft (TrimRight (ToText( cdbl({A.pk_unit_price}),"###,###,###.0000000000", 10)));
NumberVar LengthToDecimal;

if {@DisplayOpt} [1] = "1" then
LengthToDecimal := instr(sUnitPrice, ".");
while (right(sUnitPrice, 1) = "0" and (len(sUnitPrice) > LengthToDecimal + 2)) Do sUnitPrice := Left(sUnitPrice, len(sUnitPrice) - 1);

if cdbl(sUnitPrice) = 0 then
sCol5Temp := ""
Else
sCol5Temp := Replace (sUnitPrice," ",chr(0));

if {@DisplayOpt} [1] = "2" then
if {@MarketValue} = 0 then
sCol5Temp:= ""
else
sCol5Temp:=ToText ({@MarketValue},2);

if {@DisplayOpt}[1] = "3" then
sCol5Temp:=ToText ({A.pk_price_date});

sCol5Temp;



 
I tried it in 8.5 and it doesn't like your declarations and types. I don't see StringVar as an option in 8.5.

Try:
Dim sCol5Temp as string:
Dim sUnitPrice as string:
sUnitPrice = TrimLeft (TrimRight (ToText( cdbl({A.pk_unit_price}),"###,###,###.0000000000", 10)));
 
Thank you so much.
I was unable to find the error for we don't have CR8.5.
You are a life saver.

Thanks again

JoeBait
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top