Menu

#91 Add DeleteSlot to sqrat::object

None
accepted
nobody
5
2016-05-17
2016-05-11
bluehazzard
No

It would be nice to have the function DeleteSlot in the Object class

~~~~~

virtual bool DeleteSlot(SQInteger index)
{
    if(GetType() != OT_TABLE)
        return false;

    sq_pushobject(vm, GetObject());
    sq_pushinteger(vm, index);
    sq_deleteslot(vm,-2,false);
    return true;
}

virtual bool DeleteSlot(const SQChar* slot)
{
    if(GetType() != OT_TABLE)
        return false;

    sq_pushobject(vm, GetObject());
    sq_pushstring(vm, slot,-1);
    sq_deleteslot(vm,-2,false);
    return true;
}

~~~~~

Discussion

  • bluehazzard

    bluehazzard - 2016-05-11

    a sq_pop is missing at the end of the functions...

     
  • Wizzard

    Wizzard - 2016-05-17
    • status: open --> accepted
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB