Author Topic: How to delete all elements in a hash table in Slick-C?  (Read 1605 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
How to delete all elements in a hash table in Slick-C?
« on: April 28, 2018, 03:58:06 PM »
I want to remove all elements of a hash table in a Slick-C macro.

I see there is a function _deleteel() to delete an individual element of the hash table, but how to delete all the elements?

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: How to delete all elements in a hash table in Slick-C?
« Reply #1 on: April 28, 2018, 04:01:26 PM »
Found it - _makeempty()

Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
Re: How to delete all elements in a hash table in Slick-C?
« Reply #2 on: May 01, 2018, 02:01:36 PM »
You can also just assign null.

Code: [Select]
    bool been_there_done_that:[];
    been_there_done_that:["Shenandoah National Park"] = true;
    been_there_done_that:["Everglades National Park"] = false;
    been_there_done_that = null;