Qbasicnews.com

Full Version: FreeBASIC wishlist...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Dynamic arrays inside UDTs:
Code:
Type MyType
Arr(0) As Integer
End Type
Dim Blah(10) As MyType
reDim Blah(0).Arr(10)
reDim Blah(1).Arr(40)
reDim Blah(2).Arr(100)


Setting variable values on declare:
Code:
Dim a As Integer = 100
The second one will be in 0.11b, v1c has said he won't release 0.11b without it. I dunno about the first one.
1st one I don't think it'be implemented, couse that's not what UDT's are, but you can use pointers instead.
Freebasic is nearly perfect, but I could see creating a compatibility lib which would emulate ModeX and VESA modes. If anyone other than myself is interested in such a thing, where you'd just have to replace POKE, CALL INTERRUPT and OUT statements with compatPOKE, CALL compatINTERRUPT and compatOUT, I might be willing to write it.
Quote:1st one I don't think it'be implemented, couse that's not what UDT's are, but you can use pointers instead.

It would still be nice to have, VB has it, or so I have been told.
SJ Zero: new gfxlib in CVS already emulates all QB modes, plus adds new modes from 320x240 (like ModeX) up to 1024x768 and hi/truecolor. POKE to video memory is possible too, even though you first have to get a pointer to the (virtual) framebuffer via new function SCREENPTR:
Code:
DIM video AS BYTE PTR
SCREEN 14 ' 320x240
video = SCREENPTR
SCREENLOCK
' Let's write a white pixel in top-left corner of screen
POKE video, 15
SCREENUNLOCK
SLEEP
OUT, INP and WAIT emulation for palette and vsync management is there too.
Just three words:

I
CAN'T
WAIT

Wink
Dynamic arrays in UDTs sounds like it would take away from the structured nature of TYPES. I mean, maybe you could have automated pointers to dynamic arrays, but I thought that TYPEs were optimized such that all entries are the same length, and padded to a power of 2 for fast lookup.
coolness!!!
I think FB handles arrays as pointers anyway, so the array in a udt would be a 4 byte pointer in memory. Actuall manipulation of the udt data to an external source would just require it to reference that pointer.
Pages: 1 2