Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DEFINT A-ZFUNCTION... ARRGH!
#11
Barok,

INT rounds down, but QB converts a floating point to an integer by rounding to the nearest integer the same as using CINT. If the whole number part of the float is even it rounds .5 down. If the whole number part is odd it rounds .5 up.
Code:
0.5  -> 0
0.6  -> 1

1.4  -> 1
1.5  -> 2
Cheetah,
Usually QB would create this code
Code:
DEFINT A-Z
FUNCTION something (x,y,z)
It inserts the DEFINT statement on the line before the sub/function header. If it is doing it all on one line then you have a corrupted program.
hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)

For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Reply
#12
Yes, with some codes it always does that way. But with some other (more complex...) codes it always fails. It is interesting that it only appears in the codes written by me, but the codes what i download or try out. (But after fixing it can compile them without any warnings or errors)

The mouse problem what i wrote in the title existed in all versions of QB and i experienced it on two computers (on a P233 and on my 4.86). And experienced with two types of mouse drivers: the basic Microsoft one, and a Genius one.

I downloaded that QB4.5 from QB4All, so i do not think that it is corrupted...

The bug appears this way:

If i have a program with
Function a(x)
Function b(z,u)
Function c(h,e,t,a)

then at first Run, it goes. After some editing somewhere it merges a(x) with Defint and say Error. After fixing it, it works again. On the next Run, b(z,u) fails. Then c(h,e,t,a). After it starts again from a(x)...


INT, CINT, FIX - I think INT is the fastest and usually the most useful...
fter 60 million years a civilization will search for a meteorite destroying most of the living creatures around this age...

There must be a better future for the Cheetahs!

http://rcs.fateback.com/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)