[06 Jan 2010] Is it possible to check if Table item table[numx] exists or not?

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Bugala
Posts: 1410
Joined: Sun Feb 14, 2010 7:11 pm

[06 Jan 2010] Is it possible to check if Table item table[numx] exists or not?

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 06 Jan 2010 18:30:06 -0000

I would need to check if some table item exists and then react on it, if it does.

Is this possible to do someway:

example:

Code: Select all

If table[num1][num2].varx "EXISTS" then table[num1][num2].varx=3
It would be useful for example on creating enemies, just check num1=num1+1 until table item doesnt exist and add new one there.

another one, concerning same. Is it possible to destroy table item?

I mean,

Code: Select all

deletetableitem table[num1][num2]
and after that if i point to table[num1][num2].varx, it would give me error, since it wouldnt exist anymore.
PEB
Posts: 591
Joined: Sun Feb 21, 2010 1:28 am

[06 Jan 2010] Re: Is it possible to check if Table item table[numx] exists or not?

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 6 Jan 2010 11:44:34 -0800 (PST)

Check out the documentation for RawGet() and RemoveItem().
Locked