Game Maker Games, Articles, Tutorials & More

Game Maker Network


Howdy, Guest! Please sign in or register an account.

Print

ds_stack_repr

By Daniel · December 29, 2008

Returns a string representation of the given stack

// ds_stack_repr(id)
// Returns a string representation of the given stack

var copy, s;

copy = ds_stack_create();
ds_stack_copy(copy, argument0);

s = '';
while (!ds_stack_empty(copy)) {
  if (s != '')
    s += ', ';
  s += string(ds_stack_pop(copy));
}

s = '[' + s + ']';
return s;

Comments

There are no comments to display.

Post a Comment

You must be signed in to post comments.

Advertisement