News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Shifting an array Element downwards?

Started by Draco9898, August 09, 2005, 11:07:50 PM

Previous topic - Next topic

Draco9898

Is there a way to do this with my typed array?

For now I'm resorting to this, ouch..:

PlayBASIC Code: [Select]
Mon(X).X#= Mon(MaxMonsters).X#
Mon(X).Element= Mon(MaxMonsters).Element
Mon(X).Level= Mon(MaxMonsters).Level
Mon(X).MaxHP#= Mon(MaxMonsters).MaxHP#
Mon(X).Hp#= Mon(MaxMonsters).Hp#
Mon(X).MaxMP#= Mon(MaxMonsters).MaxMP#
Mon(X).Str#= Mon(MaxMonsters).Str#
Mon(X).BatSpd#= Mon(MaxMonsters).BatSpd#



DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


Draco9898

QuoteCopyArrayCells

Ok, cool...But this doesn't seem to do what I wanted above? For some reason...


CopyArrayCells Mon().TMon,X,1,Mon().TMon,MaxMonsters,1,1
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin

It's purpose is to copy array elements, typed or otherwise. Which is what the above tidbit is doing ?..  

 You'll have to post a cut down example..

Draco9898

I got it now, I had the destination and the source flip-flopped, thanks though
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin