Using Crystal 8.0 in PeopleSoft 8.8 and have used Crystal since Ver. 5. Trying to get rid of leading zeroes in a field that is stored as a character in an Oracle database. Here is the code:
Local Stringvar x := totext({N87CM607.N_CHKGM_AMT});
Local Numbervar i;
Local Numbervar y;
Local Numbervar z;
if {N87CM607.N_CHKG_MO_AMT_STAT} = '1' then
'CASH DEP'
else if {N87CM607.N_CHKG_MO_AMT_STAT} = '3' then
(
y := length(totext({N87CM607.N_CHKGM_AMT}));
Local Numbervar z;
z := Instr(x,'0');
for i:= 1 to y do
(
if z = 1 then
x := Right({N87CM607.N_CHKGM_AMT},Length(x)-1);
z := Instr(x,'0');
else
exit for
)
)
~~~~~~~~~~~~~~~~~~
I'm getting an error as CR is expecting a "" on the else w/in the for loop. I'm not sure of the syntax used to exit the for loop.
Local Stringvar x := totext({N87CM607.N_CHKGM_AMT});
Local Numbervar i;
Local Numbervar y;
Local Numbervar z;
if {N87CM607.N_CHKG_MO_AMT_STAT} = '1' then
'CASH DEP'
else if {N87CM607.N_CHKG_MO_AMT_STAT} = '3' then
(
y := length(totext({N87CM607.N_CHKGM_AMT}));
Local Numbervar z;
z := Instr(x,'0');
for i:= 1 to y do
(
if z = 1 then
x := Right({N87CM607.N_CHKGM_AMT},Length(x)-1);
z := Instr(x,'0');
else
exit for
)
)
~~~~~~~~~~~~~~~~~~
I'm getting an error as CR is expecting a "" on the else w/in the for loop. I'm not sure of the syntax used to exit the for loop.