[MAIN] [News] [Intro] [Features] [Download] [Installation] [Support] [Support+] [Docu] [Tutorial] [Bugs] [forum ] [wiki] [Mirror] [Authors] [Future] [License] [Win98 Setup Bug] [Subscribe] |
Bug DescriptionThe 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 BugThe STR function converts the operator to a LONG prior to converting to STRING.SolutionThe following line in the COMMAND(STR) should be updated:RESULT = CONVERT2STRING(CONVERT2LONG(Op));to: RESULT = CONVERT2STRING(Op); Bug Workaround Until Solution is AvailableDo not use the function STR for string or double arguments. Write var&"" instead in case the variable var is double.AcknowledgementMitchell Greess [m.greess@solutions-atlantic.com] has discovered this bug and proposed the fix. |