Split long source lines?

BlitzMax Forums/BlitzMax Beginners Area/Split long source lines?

remz(Posted 2006) [#1]
Is there a way to split a long line into several lines? (like the \ symbol in C)

I want to initialize an array like this but with a lot of values:
Local myarray:Int[] = [23,45,76,67,...]

Bonus question:
I don't understand why I can't initialize an similar array with Bytes instead of ints, i.e.:
Local myarray:Byte[] = [2]
will not compile, giving:
Unable to convert from 'Int Array' to 'Byte Array'.


Perturbatio(Posted 2006) [#2]
1:
Local myArray:Int[] = [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0..
						 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0]
2:
Local myArray2:Byte[] = [Byte(1),Byte(2),Byte(3),Byte(4),Byte(5)]

You can't initialize the array because they are integer literals, you would need to cast them to byte.


N(Posted 2006) [#3]
To make a line continue onto the next, affix it with '..'.

To make an array of bytes, you have to specify the type of number.

e.g., Local myArr:Byte[] = [2:Byte, 3:Byte, 4:Byte]

Edit: Curse you, Perturbatio. Although I have to say I like my answer to #2 better.


sswift(Posted 2006) [#4]
Bah.


N(Posted 2006) [#5]
Congrats, sswift, you're #3.


Perturbatio(Posted 2006) [#6]
yeah, your answer is better.

but mine was first! Mwahahahahaaa! }:]


remz(Posted 2006) [#7]
Thanks a lot guys :)

Although I couldn't find this '..' special character in the doc, it works great!


N(Posted 2006) [#8]
Yeah, well, the docs suck. Better to just ask here if you have a question.


Yan(Posted 2006) [#9]
I know I'm being an also ran here, but...

The BlitzWiki FAQ