Qbasicnews.com
Bug Reports - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: General (http://qbasicnews.com/newforum/forum-6.html)
+--- Forum: General/Misc (http://qbasicnews.com/newforum/forum-18.html)
+--- Thread: Bug Reports (/thread-5202.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30


Bug Reports - v3cz0r - 01-09-2005

You can't do len(UDT) in QB, you are actually doing len(single) there, "u" is being magically declared by QB as a Single var (the default type).

FB returning different values is actually a bug, i added a proc to calculate the real-len of UDT (w/o padding) to speed up SWAP and user type assignament s(so the padding is not swapped/copied), and LEN() was calling the same code.. fixed.

Yeah i lied, you actually can have chr$(0) on var-len strings, they are never scanned for the null-char as fixed-len are. But calling any API function passing that string will mostly fail, as PRINT does -- i can't do anything, you got byte arrays in FB, i dunno why someone would put a null-char inside a string -- if FB strings were not null-terminated, EVERY function call with string arguments to ANY lib would need this: "stringparam + chr$( 0 )", what wouldn't be quite fun to do all the time -- hey, they are living with that "restriction" in C for decades, nobody complained..

And yeah, FB integers are 4 bytes long, you know, it's a 32-bit compiler, it makes sense -- and yet, you can do defshort a-z or declare all vars as "v as short" if you really need 16-bit integers.


Bug Reports - 1000101 - 01-09-2005

Quote:zlib seems to use STDCALL on Windows, but the symbols on the DLL end up with CDECL names (no @), i dunno.

New version got the put/get #f, , array(), will store/load the full array, as in VB -- you can't use just "array" tho.

I found thesolution to the zLib problem. It turns out the answer was in FreeImage. You need sed.exe to extract the info for pextract.exe to work.

Also, if you want them, I have zLib and FreeImage working examples.

This is a bit of a request, but it would be handy to be able to have constants have pre-computed function results for come functions. ie:
Code:
Const myCRLF = Chr$(13) + Chr(10)



Bug Reports - v3cz0r - 01-09-2005

Just added literal strings with escape chars, as Antoni suggested, you will be able to do:

Code:
const crlf = "~n"

On next release.. and ~t, ~13 ~0 (don't do this! ;) etc.. parsing is enabled by OPTION ESCAPE.


Bug Reports - Z!re - 01-09-2005

Quote:error 59: Type mismatch, at parameter: 2

The sub expects an integer, I passed:
a_constant*a_float

Same result if i do:
a_constant*RND

QB would auto-convert, you could pass floats to subs where they expected integers, integers to floats aso...


Bug Reports - relsoft - 01-09-2005

Wouldn't that slow things down?

You could cast it like so:

mufunk(int(floatvalue))

oh, wait! CINT would be faster. :*)


Bug Reports - Z!re - 01-09-2005

Putting INT() or CINT() around it doesen work, i still get the same error.

If i do:
tempvar = a_constant*RND '(or float)
mysub tempvar

It works...


Bug Reports - adosorken - 01-09-2005

Looks like type abstraction is b0rk3n dude...PTCXL is suddenly generating "Type mismatch" errors when passing Ubytes to a function which expects Integers. This never happened in previous versions of fbc, and the PTCXL code that causes the new errors has been untouched since its release back on December 7th. Big Grin Granted I've rewritten the two portions of code that cause the problem, but uhh...isn't FBC supposed to recast these? :???:


Bug Reports - Z!re - 01-09-2005

Ya, my code worked in v0.09b, no changes whatsoever.


Bug Reports - undertow - 01-09-2005

There seems to be something wrong when you pass a string from a type into a sub/function.
The following code works in QBasic but not in FB.
Code:
declare sub F(c$, u%)
type LT
   u  as integer
   p  as string * 10
end type


dim shared L(1 to 2) as LT
L(1).p = "Hello": L(1).u = 1
L(2).p = "Hi": L(2).u = 2

print L(1).p, L(1).u
print L(2).p, L(2).u
print
F(L(1).p,L(1).u)
F(L(2).p,L(2).u)
print
print L(1).p, L(1).u
print L(2).p, L(2).u

sleep

sub F(c$, u%)
print c$,u%
end sub
The output is

Code:
Hello          1
Hi             2

Hello          1
Hello          2

Hello          1
Hello          2
whereas it should be

Code:
Hello          1
Hi             2

Hello          1
Hi             2

Hello          1
Hi             2

This bug caused me many headaches.


Bug Reports - v3cz0r - 01-09-2005

FB won't allow different types passed by reference anymore (unless they are constants), so if you have:

Code:
declare sub foo( a as single )
declare sub bar( a as integer )

You have to do:

Code:
foo csng(a%*rnd)

bar cint(a!)

Or much faster, declare all args as byval using: option byval, done..


About the string, yeah, it's on the readme.txt, it's a known bug, may be fixed later, sorry.[/quote]