123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|588|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Dim Field?

Fri, 30 Jan 2009, 04:21
HoboBen
I'm too sleepy this morning to do any real programming, so I'm just porting my windows shortcut (.lnk) reader/writer unit from Cobra to Blitz in the hopes that some of you find it useful.

Anyone know how I would get an array as a type field though? I tried Field Dim lAttribute(13) and Dim Field lAttribute(13) but it doesn't like either.

My google skills fail today.

-=-=-
blog | work | code | more code
Fri, 30 Jan 2009, 04:41
Jayenkai
You can't, you have to use BlitzArrays instead.
Same thing, though.. no idea why Mark made a difference, to be honest!

Field lAttribute[13] (Although, maybe 14.. I think BlitzArrays do the 0-(limit-1) thing.)

-=-=-
''Load, Next List!''
Fri, 30 Jan 2009, 04:49
HoboBen
Aha, thanks Jay!
Fri, 30 Jan 2009, 07:38
steve_ancell
I don't like using Blitz Arrays coz they can't be re-dimmed.
Fri, 30 Jan 2009, 07:54
Phoenix
There's banks, which can be "re-dimmed".
Fri, 30 Jan 2009, 08:04
steve_ancell
Oh yeah I've used banks, very useful. Thanks for pointing that out Phoenix. I'm still half asleep I think.
Fri, 30 Jan 2009, 08:04
JL235
I believe there is a way to redim arrays. I remember I used to do it to clear an array. But the whole array system in Blitz is just a mess.
Fri, 30 Jan 2009, 08:06
Jayenkai
Why would you ever want to redim an array?
Fri, 30 Jan 2009, 08:07
steve_ancell
Yeah you can re-dim normal arrays, but you have to declare them at the beginning of the program. Then you can just use the same Dim() command to redim the original array. But you do lose any data previously stored, so you need to have an identical slave array as a tempory store, then simply copy back the data into the original array.
Fri, 30 Jan 2009, 08:09
steve_ancell
Jayenkai Why would you ever want to redim an array?


I often use that for a resize operation in level editors.
Fri, 30 Jan 2009, 08:50
JL235
Jayenkai Why would you ever want to redim an array?
If you ever wanted to resize it.

This is espeically useful as an alternative to a linked-list for times when you want a list of an unknown size. Certain operations for an array based list are far less expensive when compared to a linked-list (like random access).

But what really annoyed me about them is the fact that you cannot pass them into functions, return them from functions or find out how big they are.