Bug Report 2001/10/19-v1.0b26-br01


[MAIN]
[News]
[Intro]
[Features]
[Download]
[Installation]
[Support]
[Support+]
[Docu]
[Tutorial]
[Bugs]
[forum ]
[wiki]
[Mirror]
[Authors]
[Future]
[License]
[Win98 Setup Bug]
[Subscribe]
Bug Report id=2001/10/19-v1.0b26-br01
Affected versions:v1.0b26
Severity:Low

Bug Description

The STR function does not handle DOUBLE and STRING variables correctly. The following program produces incorrect results:
varstring = "a string"
varReal = 60.5e0
varInteger = 60
varZerp = 0
varNegReal = -60.5e0

print "'", varstring, "'\t'", Str(varstring), "'\n"
print "'", varInteger, "'\t'", Str(varInteger), "'\n"
print "'", varReal, "'\t'", Str(varReal), "'\n"
print "'", varNegInteger, "'\t'", Str(varNegInteger), "'\n"
print "'", varNegReal, "'\t'", Str(varNegReal), "'\n"

The following results are produced:
'a string'       '0'
'60'     '60'
'60.500000'      '60'
'-60'    '-60'
'-60.500000'     '-60'

Bug Reason, What Causes the Bug

The STR function converts the operator to a LONG prior to converting to STRING.

Solution

The following line in the COMMAND(STR) should be updated:
RESULT = CONVERT2STRING(CONVERT2LONG(Op));

to:
RESULT = CONVERT2STRING(Op);

Bug Workaround Until Solution is Available

Do not use the function STR for string or double arguments. Write var&"" instead in case the variable var is double.

Acknowledgement

Mitchell Greess [m.greess@solutions-atlantic.com] has discovered this bug and proposed the fix.

This page was generated January 28, 2010 9:58:43