Basic Guy
2009-11-25 13:57:34 UTC
Are there any known issues or bugs for the PowerBasic/DOS 3.5 int()
function?
I'm debugging various programs that use the int() function and there's
never any problem with it until at some point PB breaks and claims an
error 5 on the int() line.
for example, the line is something like this:
rt = int (realtime * 10) / 10
If realtime = 10.34567, then I want rt to be 10.3 (ie to strip away all
but one decimal place away from realtime).
I have no idea why that line seems to work fine most of the time, then
all of a sudden stop working.
Does the argument for int() need to be less then 65535?
Also, I'm doing serial I/O between two PC's, and I sometimes get error
57 on a line like this:
a = loc(5)
if a > 0 then a$ = input$(1,5)
where a com port was previously opened under handle #5. I'm checking to
see if there is anything to read in the com buffer before I try to
perform the read, and always there are a few dozen characters in the
buffer when the error happens.
The error 57 happens on the input line.
I have the meta statement COM$ 4096 (to set up a buffer for serial
communications) so I don't think that this is a buffer overrun
situation.
function?
I'm debugging various programs that use the int() function and there's
never any problem with it until at some point PB breaks and claims an
error 5 on the int() line.
for example, the line is something like this:
rt = int (realtime * 10) / 10
If realtime = 10.34567, then I want rt to be 10.3 (ie to strip away all
but one decimal place away from realtime).
I have no idea why that line seems to work fine most of the time, then
all of a sudden stop working.
Does the argument for int() need to be less then 65535?
Also, I'm doing serial I/O between two PC's, and I sometimes get error
57 on a line like this:
a = loc(5)
if a > 0 then a$ = input$(1,5)
where a com port was previously opened under handle #5. I'm checking to
see if there is anything to read in the com buffer before I try to
perform the read, and always there are a few dozen characters in the
buffer when the error happens.
The error 57 happens on the input line.
I have the meta statement COM$ 4096 (to set up a buffer for serial
communications) so I don't think that this is a buffer overrun
situation.