Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array question
#1
When an array is declared without type how does qb know how much storage to give it?

Also do the elements get stored consecutively in memory?
Reply
#2
1.- The default data type is SINGLE. If you don't specify another one, QB creates stuff to be SINGLE (which sucks).

2.- More or less, yes.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
but the 2nd answer is still helpful.

thx
Reply
#4
Sorry, I misread your 2nd question Smile The answer is: Yes Wink (I was thinking on the group formed by all the variables and arrays in your program - if you are talking about just one concrete array, yeah: every element gets stored in order right behind the previous one. If the array is 2D, they are stored in column order, this is, (0,0), (1,0), (2,0), ... (0, 1), (1,1), (2,1), ..., (0,2), (1,2), (2,2), ...)
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)