Type in a type

Blitz3D Forums/Blitz3D Beginners Area/Type in a type

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for all the help guys. I think I'm starting to get my head around this stuff.

> Dont be afraid of arrays tho enay, arrays can be your
> friend even if they do have to be global and fixed size.

That's the thing, I'm the array master. I love them. My last 5 blitz games have all been created using arrays.
But I felt like having a go with types for a change since I've recently mastered the art of OOP in C++ and I kind of want to design my code better.

Unfortunately I've now get myself stuck a bit, well not stuck. But I feel I'm doing things wrong.

So onto my next quick questions :)

Can I loop backwards like

for loop = 2000 to 1 step -1

I've seen all this Insert Before and After commands but I can't figure out how to start at the back of a list. In my code I want to start at the last entry. Like a LIFO badger.

But at the moment I have to do this:-
moo=0

For b.badger Each badger
moo=moo+1
Next

spamflan = 0
For b.badger Each badger
if moo=spamflan then
endif
Next

Like:-

For Last b.badger To First b.badger

Next

Also I want to do the same but start in the middle. With a normal for loop and an array I'd just do this:-

for loop=low_num to high_num
badgers(loop)
next

Or something.

for loop =high_num to low_num step -1
badgers(loop)
next

Basically, I want to access a group of badgers inside a sheep with a pointer and then scan consecutive badgers in either direction, just like I've shown above with my array of badgers.

Anyway, thanks in advance for trying to help (again) :)
I appreciate it.