Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Is there a simple command to Null a Type

Author
Message
okee
10
Years of Service
User Offline
Joined: 1st May 2014
Location: Ireland
Posted: 7th Jul 2015 21:26
Looking for a simple way to Null a type
The type contains arrays of types so looking for one single command that will null/blank it
Tried various different ways but none seem to work

Anyone know ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Jul 2015 23:06
There is no null.
But you can set the array lengths to zero.



Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
okee
10
Years of Service
User Offline
Joined: 1st May 2014
Location: Ireland
Posted: 7th Jul 2015 23:12
Thanks BatFink

I'm using

MyVariable.MyArray.length = -1

at the moment, as using 0 will still leave element 0 in the array
It's just i have 5 or 6 type arrays and wanted to clear them all with one command instead of having to do each one.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Jul 2015 23:49
You could create MyVariable as an array of one element. Then you can...

MyVariable.length = -1

I always leave 1 element in the array, to prevent silly errors on my part. 1 element arrays are more forgiving than zero length arrays.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-11-21 15:35:29
Your offset time is: 2024-11-21 15:35:29