Anyway, let's get to it!
The DS Control extension is designed to give you a bit more control over your data structures. It adds the following functions:
-ds_grid_clip: Allows you to crop a ds_grid down, removing extraneous borders of a single supplied value. For example, you can clear the grid with 0's, then fill it as necessary. Then this function can remove the bordering 0's and return only the useful part of the grid.
-ds_list_pad: Pad the beginning, end, or both of a ds_list with a specified value.
-ds_list_trim: Trim a specified value off the beginning, end, or both of a ds_list, leaving all other values (as well as "trapped" values of the specified one surrounded by other values) intact.
-ds_stack_insert: Inserts a specified value into a ds_stack at the specified position from the bottom of the stack (bottom=position 0).
-ds_stack_delete: Deletes the value at a specified position in a ds_stack.
-ds_queue_delete and ds_queue_insert: Same as their "stack" equivalents, only the position is from the head, the head being position 0.
These are all useful no doubt, especially the stack and queue insertion and deletion scripts. Bet you never thought you could treat stacks and queues like lists when you needed to, huh ?
As an added bonus, an optional argument called "destroy" in all of these functions allows you to specify whether the original data structure should be modified, or a modified copy should be returned (default behavior).
Without further ado, here is the .GEX (along with the .GML for those who like scripts better):
If you use the .GEX, be sure to read the help file! If you use the .GML scripts, be sure to read the README script!
Comments are appreciated .
Edited by IceMetalPunk, 02 January 2008 - 09:22 AM.