Hi all, I want to do this:
Though it receives a compile error "cannot convert null to integer". ownedPokemon is a 2D variable array of custom objects derived from my "Pokemon" class. So I take it custom objects are stored internally as integers?
I want to null them because they are initially null and I have other functions which check if I have assigned data to them.
Once I am finished with an element of ownedPokemon I want to null it so these other functions will recognise them as "available", so to speak. I'm aware of a workaround which involves me setting these variables to a set number like 0 and treat 0 as a "null" value of sorts, but I was wondering if there's a way to actually remove the value itself to make it truly null?
Edit: side question. The below will compile:
The apostrophe appears to internally convert text as a number, meaning it's not setting it to an null value but rather a number. Is this correct?
JASS:
set ownedPokemon[index1][index2] = null
Though it receives a compile error "cannot convert null to integer". ownedPokemon is a 2D variable array of custom objects derived from my "Pokemon" class. So I take it custom objects are stored internally as integers?
I want to null them because they are initially null and I have other functions which check if I have assigned data to them.
JASS:
If ownedPokemon[index1][index2] == null
// Found an unused element
// Perform some actions
endif
Once I am finished with an element of ownedPokemon I want to null it so these other functions will recognise them as "available", so to speak. I'm aware of a workaround which involves me setting these variables to a set number like 0 and treat 0 as a "null" value of sorts, but I was wondering if there's a way to actually remove the value itself to make it truly null?
Edit: side question. The below will compile:
JASS:
set ownedPokemon[index1][index2] = 'null'
The apostrophe appears to internally convert text as a number, meaning it's not setting it to an null value but rather a number. Is this correct?