[futurebasic] Re: [FB] Maximum floating point digits displayed

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2009 : Group Archive : Group : All Groups

From: Bill Zielenbach <bill@...>
Date: Sat, 24 Oct 2009 14:30:31 -0400
Jay and Brian,

Perhaps it would help you to see the application.

I have a function Audittrail that I call when I'm debugging.

local FN Audittrail
print# 5,gfunction$+": ",gmessage$
end fn 

global gfunction$,gmessage$,gcolon$,gdebug%
gcolon$=":"

//read gdebug% from an input control file of parameters for the program
// if=0, debugging is off globally, except as noted below
// if=1, debugging is on globally, unless shut off in individual fn's by
setting localdebug%=0 below

//open file#5 as an ASCII text file named "programname.audittrail"

Then, in any area I'm trying to debug like fn NotWorkingCorrectly

local fn NotWorkingCorrectly

dim localDeBug%,DeBugFlag%
localDeBug%=1  // allows me to turn off all debugging for just this
//function; 0 is off, 1 is on
DeBugFlag%=localDeBug%*gDeBug%
// DeBugFlag%=1    / /  if un"remarked" will turn debugging on in this FN
// regardless of value of gDeBug%

//possible buggy calculation of gstartingx#(ic%)

long if DeBugFlag%>0
gfunction$="fn NotWorkingCorrectly" // this just helps me determine where
// the debugging output came from
gmessage$="ic%,gtartingx#(j%)="
for ic%=1 to 3
gmessage$=gmessage$+gcolon$+str$(ic%)+gcolon$+str$(gstartingx#(ic%))
next ic%
fn audittrail
end if

end fn

If the program crashes, or is stopped intentionally, I open file
programname.audittrail with TextEdit and examine the results, copy paste
them into spreadsheets for other checking, etc.

This was designed to be a quick and dirty means of debugging. I make
extensive use of the "using" statement when trying to format nicely, but
don't take that time and effort here.

There was some control field ( _FBMaxFloatDigits or the like) that Staz told
me to set to 15 that would override the default value of 8. My FB 4.3
programs all run in the 15 digit mode. Ever since I moved to 5.3 and above,
it's 8 digits and I can't find/remember the blooming control field.

B.T.W., I am systematically adding
#if _MyDebugStuff

// debugging statements

#endif

to all my routines so that when they are checked out the code can be
eliminated from the compile.

Bill