Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug Reports
sdl sdlvideo.bi file has a bug in sdl_Rect structure:
change it to:

Code:
type SDL_Rect
    x as short      'integer
    y as short      'integer
    w as ushort   'uinteger
    h as ushort    'uinteger
end type
url]http://fbide.sourceforge.net/[/url]
Reply
Found another one. fbc doesn't complain on this snippet but the assembler does:

Code:
Declare Sub DoFoo()

dim Shared WhichOne as short

WhichOne = 0

Sub DoFoo()
   WhichOne = 1 - WhichOne
End Sub

Error messages returned:

Code:
test.asm: Assembler messages:
test.asm:48: Warning: using `%ax' instead of `%eax' due to `w' suffix
test.asm:49: Error: suffix or operands invalid for `mov'
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
Fixed, will be on next rls, thanks.

Code:
[fixed] "imm op short var" was allocating the wrong register type, due an integer imm optimization at AST (v1c)
Reply
Thanks Smile

I found another one. The compiler (or the assembler) seems to have trouble with long strings in long lines:

Code:
Declare Sub Pres (t$)

' Isolate error

CLS
PRINT "Test 1 :: Long string"

st$ = "FATHER: 'I won't listen to you if you don't convince me that I can be proud of you! Just like before you told me you didn't want to be a lumberjack!'@'Besides that... I can't find a decent log today!'"
PRINT "OUTSIDE THE SUB, THIS IS THE STRING :: "; st$
Pres st$

PRINT
PRINT "Test 2 :: Split String (this works)"

st$ = "FATHER: 'I won't listen to you if you don't convince me that "
st$ = st$ + "I can be proud of you! Just like before you told me you "
st$ = st$ + "didn't want to be a lumberjack!'@'Besides that... I can't "
st$ = st$ + "find a decent log today!'"
PRINT "OUTSIDE THE SUB, THIS IS THE STRING :: "; st$
Pres st$


SUB Pres (t$)
   PRINT "INSIDE THE SUB, I GOT THIS STRING :: ";t$
END SUB

The string "st$" resulting is trimmed in the first test whether by the compiler or the assembler.

I had to manually split like 200 lines with text in my text adventure Big Grin
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
heh That's tedious. It does work fine when the string is grabbed with line input, though, as I'm just storing all the text in external files.
Reply
Literal strings max length is now 1024 chars, enough? ;)

Download the new version, btw.. it's out.
Reply
Minor difference in INT function behavior. It seems like QB's INT returns a LONG, while FB's INT returns floating point:
Code:
PRINT INT(1000000000)
QB shows 1000000000, FB 1e+009

I think this would cause expressions involving INT to use more floating point math than necessary. Example:
Code:
PRINT int% + INT(float!)
But I guess that's not much of an issue on modern processors. I'm still freaked out that floating point division is faster than integer division - maybe FB's INT is better the way it is.
Reply
Alright, I was writing a program to automatically generate DECLARE statements for any SUBs/FUNCTIONs in a file/in a group of files and I needed to use three Windows API functions: FindFirstFile, FindNextFile and FindClose, as follows:

Code:
Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Integer
Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Integer, lpFindFileData As WIN32_FIND_DATA) As Integer
Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Integer) As Integer

These functions take a parameter of type WIN32_FIND_DATA (who requires FILETIME as well):

Code:
Type FILETIME
    dwLowDateTime   As uinteger  
    dwHighDateTime  As uinteger  
End Type

Type WIN32_FIND_DATA
    dwFileAttributes    As uinteger  
    ftCreationTime      As FILETIME  
    ftLastAccessTime    As FILETIME  
    ftLastWriteTime     As FILETIME  
    nFileSizeHigh       As uinteger  
    nFileSizeLow        As uinteger  
    dwReserved0         As uinteger  
    dwReserved1         As uinteger  
    cFileName           As String * 260 - 1
    cAlternate          As String * 14 - 1
End Type

Now, I've got my functions and their UDTs. So let's give them a call:

Code:
Dim FindHandle As Integer
Dim FindData As WIN32_FIND_DATA

FindHandle = FindFirstFile("*.*", FindData)
If FindHandle <> -1 Then
   Do
      ' I need to print the file name:
      Print FindData.cFileName
   Loop While FindNextFile(FileHandle, FindData)
End If

However, that code does not work... the filenames printed are not the whole filenames - they are missing their first four characters. I suspect this is because the strings in FB are stored as (size, data), where size is a four-byte long integer. Since Windows copies strings directly to their address, it copies the first four characters into this unaccessible area of the string. So I had to work around this by doing the following:

Code:
' MAX_PATH is usually 260
Dim A As String * MAX_PATH Pointer

' Point to the actual string Windows stored, not the cut version:
A = VarPtr(FindData.cFileName) - Len(Long)
Print *A

This worked just fine. This took me quite some time to figure out, though, and could be a serious pain in Windows programming with FB. It's just a suggestion, but might it be possible to have a CSTRING data type, that stores its strings as NULL-terminated values? It'd be a little weird, but it would work.
color=blue]subxero - admin at this place.[/color]
Reply
okay, I found new bug:
Code:
sub test(text as string * 1)
   print text
end sub

dim a as string
DO
   a=INKEY$
   IF a>"" AND a<>chr$(13) THEN test(a)
LOOP UNTIL a=CHR$(13)
Gives some wierd result
url]http://fbide.sourceforge.net/[/url]
Reply
How can a string exceed the value of another string? I think your code is what's broken. Big Grin
I'd knock on wood, but my desk is particle board.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)