Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Old code needs fixing (problem solved)
#7
(09-27-2024, 09:31 AM)bplus Wrote: I got this from Steve at old forum and tested it today on problem encountered by Cortez at another forum.

It does not work:

(09-27-2024, 02:26 PM)bplus Wrote: The problem was not using proper Sci Notation.  Angry

First number must be between 1 and < 10 and you have to use + for positive powers of 10.

Also fine!

Big Grin  Big Grin  Big Grin

It only works when the notation works.  Pass it bad data, it returns bad results. There should've been a helper function with it somewhere called Function VerifyNum that makes certain your passing a valid number.  It's a little complex and a lot of basic error checking, and as such I didn't make it part of the main process so that it could be easily bypassed for those times when you KNEW your data was valid and didn't want to add in those extra checks for processing delays.

Back in the day, these routines were used for String Math routines, and as such reducing non-necessary error checking was an important thing to keep run time as quick as possible.  If they're not certain the data is always in valid format, then you might need to hunt down that VerifyNum (or was it CheckNum??) routine and add it as a pre-check before running the N2S$ routine.  Wink
Reply


Messages In This Thread
Old code needs fixing (problem solved) - by bplus - 09-27-2024, 09:31 AM
RE: Old code needs fixing - by Petr - 09-27-2024, 10:23 AM
RE: Old code needs fixing - by Kernelpanic - 09-27-2024, 10:59 AM
RE: Old code needs fixing - by bplus - 09-27-2024, 11:49 AM
RE: Old code needs fixing - by Kernelpanic - 09-27-2024, 12:24 PM
RE: Old code needs fixing (problem solved) - by SMcNeill - 09-27-2024, 04:15 PM



Users browsing this thread: 4 Guest(s)