01-09-2005, 07:01 PM
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.
The output is
whereas it should be
This bug caused me many headaches.
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
Code:
Hello 1
Hi 2
Hello 1
Hello 2
Hello 1
Hello 2
Code:
Hello 1
Hi 2
Hello 1
Hi 2
Hello 1
Hi 2
This bug caused me many headaches.