array.Dimensions

BlitzMax Forums/BlitzMax Beginners Area/array.Dimensions

CS_TBL(Posted 2006) [#1]
Local text$[]=["abc","def","ghi","jkl","mno","pqr","stu","vwx","yz!!!!"]
Local count:Int=text.Dimensions()
Notify count


I expect 9! :)

I get an error. :(

How do I get 9?


tonyg(Posted 2006) [#2]
Local text$[]=["abc","def","ghi","jkl","mno","pqr","stu","vwx","yz!!!!"]
Print  SizeOf(text)/4



TartanTangerine (was Indiepath)(Posted 2006) [#3]
Local text$[]=["abc","def","ghi","jkl","mno","pqr","stu","vwx","yz!!!!"]
Print text.length



gman(Posted 2006) [#4]
or
Framework BRL.Blitz
Import BRL.System

Local text$[]=["abc","def","ghi","jkl","mno","pqr","stu","vwx","yz!!!!"]
Local count:Int=text.Dimensions()[0]
Notify count

dimensions() returns an array. didnt know about length. see it in the docs now though clear down at the bottom :)


tonyg(Posted 2006) [#5]
Length? Oh yeah, there it is!
Blimey, len(text) works as well as documented


CS_TBL(Posted 2006) [#6]
ok, tnx, SizeOf/4 it'll be. :D


Perturbatio(Posted 2006) [#7]
or text.numberOfDimensions()

see http://www.blitzwiki.org/index.php/Arrays

*EDIT*
ignore that, I was at work and not really reading things.
Now I'm at home and not really reading things, but I did re-read this.