Problem in SalFmtFormatNumber

Report TD 5.x and 6.x bugs and possible workarounds.
Scott
Australia
Posts: 414
Joined: 13 Mar 2017, 23:31
Location: Sydney, Australia

Problem in SalFmtFormatNumber

Post by Scott » 29 Jul 2015, 01:41

The following code is used to write lines of text to a file & can be executed 1000's of times per file.

Code: Select all

!!CB!! 227
Set sLine = sDescription || 
         SalFmtFormatNumber( nLineQty, ' 00000;-00000' ) ||
         SalFmtFormatNumber( nLineValue * 100, ' 000000000;-000000000' ) ||
         SalFmtFormatNumber( nTotalWaiver * 100, ' 000000000;-000000000' ) ||
         SalFmtFormatNumber( nTotalStamp * 100, ' 000000000;-000000000' ) ||
         SalNumberToChar( 13 ) || SalNumberToChar( 10 )
Call SalFileWrite( hUploadFile, sLine, nRecLen )
Occasionally, SalFmtFormatNumber inserts a ? character between the leading space (or -) & the first 0. eg, instead of
DESC 00001 000004000 000000000 000000000 or
DESC 00002 000002210 000000000 000000000
I'll get
DESC 00001 000004000 000000000 ?000000000 or
DESC 00002 ?000002210 000000000 000000000

This has the effect of shifting everything that follows 1 char to the right & because it's a fixed length record, the extra character causes the LineFeed (char 10) to be chopped off at the end.

Anyone come across this or have any thoughts?

frevelundfey

Re: Problem in SalFmtFormatNumber

Post by frevelundfey » 29 Jul 2015, 09:21

Hi Scott,
do you have a repro case?
I built my own one (see attachment) but could not reproduce the error on TD31 and TD63.
Regards Thomas
You do not have the required permissions to view the files attached to this post.

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 7 guests