Blitz basic?

Community Forums/General Help/Blitz basic?

rg70(Posted 2016) [#1]
Hello, I wanted to know what program closely reassembles Blitz Basic? I assumed it was Blitz Plus.When I did a search in the manuel I couldn't find anything on arrays.
thanks


RustyKristi(Posted 2016) [#2]
Yes, you can either use BlitzPlus or Blitz3D. As for arrays, just use Dim

http://www.blitzbasic.com/bpdocs/command.php?name=dim&ref=goto


rg88(Posted 2016) [#3]
thanks alot!


Bobysait(Posted 2016) [#4]
rg70 ... rg88
Level up ? GG :)


what program closely reassembles Blitz Basic?

weird question


I couldn't find anything on arrays.


Dim are not the standard "arrays", it's a structur that can be resized (with loss of the data) but must be declared like a <<Global>> variable (so, it's only for some restricted usage)

What looks more like conventionnal arrays is the << variable_name%[Size] >> syntax

(the "%" is not mandatory and by the way can be replaced by the required type [% # $] or a type (from "Type" instance))
They are static arrays so the restriction is the size MUST be a constant, but they can be created on the fly.

Also, they can be passed as function arguments or be in a field of a type.
Function PrintFloatArray(array#[10])
 For i = 0 To 9
  Print array[i]
 Next
End Function

Function PrintIntArray(array%[4])
 For i = 0 To 3
  Print array[i]
 Next
End Function


; a local array of float
Local a#[10]
For i = 0 To 9
 a[i] = Float(i)*1.7
Next

; print its content using the function above
PrintFloatArray(a)


; using array in types
Type MyType
  Field value%[4]
End Type

Local t.MyType = New MyType
t\value[0] = 5
t\value[1] = 12
t\value[2] = 3
t\value[3] = 7

; print the content of the value array of "t"
PrintIntArray(t\value)


they can also be declared as "Global" ...
And not to mention, they are severely faster than Dim structur