AndrewMozley
Programmer
I have an application where I wish to remove trailing zeroes from a fairly long (61 char) character string, and find that the code performs differently when it is being run in debug mode from how it runs as a .exe program
My code (simplified - sorry about the variable names) is :
* ltrimirn = RTRIM(sbom.irn,"0"," ")
lTrimirn = sbom.irn
DO WHILE RIGHT(lTrimirn,1) = "0" .AND. LEN(lTrimirn) > 1
lTrimirn = LEFT(lTrimirn,LEN(lTrimirn) - 1)
ENDDO
lLenIrn = LEN(lTrimIrn)
I wish to establish the length of field sbom.irn after I have removed trailing zeroes. (In fact it does not have any trailing spaces - they are all zeroes).
Running under VFP control, with breakpoints it works fine, so :
“1002005003000000 . . . .” is reduced to “1002005003” by the RTRIM command
As an exe, the string remains as “1002005003000000 . . . .”
So eventually I have replaced the code by the rather more cumbersome DO WHILE loop (above), and that works.
Has anyone else observed this sort of behaviour?
Andrew
My code (simplified - sorry about the variable names) is :
* ltrimirn = RTRIM(sbom.irn,"0"," ")
lTrimirn = sbom.irn
DO WHILE RIGHT(lTrimirn,1) = "0" .AND. LEN(lTrimirn) > 1
lTrimirn = LEFT(lTrimirn,LEN(lTrimirn) - 1)
ENDDO
lLenIrn = LEN(lTrimIrn)
I wish to establish the length of field sbom.irn after I have removed trailing zeroes. (In fact it does not have any trailing spaces - they are all zeroes).
Running under VFP control, with breakpoints it works fine, so :
“1002005003000000 . . . .” is reduced to “1002005003” by the RTRIM command
As an exe, the string remains as “1002005003000000 . . . .”
So eventually I have replaced the code by the rather more cumbersome DO WHILE loop (above), and that works.
Has anyone else observed this sort of behaviour?
Andrew