# Comet32 2018.515 execution weirdness...

[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Robert G Laurin on February 19, 2019 at 14:00:15:

Oh boy! Where to start....

I just modified a program (added a few lines of code).

These statements:

`LET VWEIGHT = 0                       ! All New Lines, except the original OneIF NUM(TALENGTH\$,ERR) > 0  LET VWEIGHT = ( NUM(TALENGTH\$,ERR) * NUM(TAWIDTH\$,ERR) * NUM(TAHEIGHT\$,ERR) ) / 5000ENDIFIF TAWEIGHT > VWEIGHT  LET WEIGHT\$ = RSUB(STR(TAWEIGHT*.001),2,6)    ! Original LineELSE  LET WEIGHT\$ = RSUB(STR(VWEIGHT*.001),2,6)ENDIF`

It is a formula to compute the Volumetric Equivalent Weight when shipping Commercial Parcels in Canada.

Where:

TAWEIGHT 5.0 is the scale weight in Grams and is never Zero
TALENGTH\$, TAWIDTH\$ and TAHEIGHT\$ are the parcel dimentsion in mm
VWEIGHT 5.0 is the Volumetric Equivalent Weight in Grams.

WEIGHT\$ 6 is the Weight converted to KG used to Print.

What is done, is first default the VWEIGHT to Zero, then if LENGTH is present, compute the VE Weight.

If the scale weight (TAWEIGHT) is greater that the VWEIGHT (or VWEIGHT is Zero) then Convert to String '99.999'.
Otherwise, use VWEIGHT to String as '99.999'

What I am seeing, is that:

If VWEIGHT is NOT calculated (default to zero), the result in WEIGHT\$ from TAWEIGHT) is always '000000'.

If VWEIGHT is calculated and TAWEIGHT > VWEIGHT, then the same line of code will give me the proper WEIGHT\$ as '99.999'

ELSE If TAWEIGHT NOT greater than VWEIGHT then WEIGHT\$ is VWEIGHT as '99.999'

I tried setting VWEIGHT to a non-zero value be default and if no calculation of (L x W x H) then the WEIGHT\$ from TAWEIGHT would still be '000000'

-----
So, the same line of code, will work or not depending if an independent calculation is performed before or not...

I put debugging lines and can confirm this behavior.

Very Strange !!

I could provide the compile source, it is over 6,000 lines before clean-up. Would also need to provide test data (ouch!)

This program worked fine since 2003 and was converted to C32 in 2011.

Windows 7 x64, Comet 32 2018.515, UTL & REL 17.02...

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?