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.

AppGameKit Classic Chat / How to check for nil/null on a Type?

Author
Message
bigtunacan
9
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 23rd Jan 2017 23:21
I need to do a check if a type has been assigned a value yet, but as far as I can tell there is not support for NIL/NULL in AGK. What I'm trying to do is something like this.

easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 24th Jan 2017 00:02
I do it like this:



Might not be the best way, but it works

Audacia Games - Latest WIP - AUTOMAYTE 2.1, AppGameKit one click deploy to Android
130,000 installs with AppGameKit and counting
bigtunacan
9
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 24th Jan 2017 00:13
Not what I was hoping to hear, but it works

Thanks
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jan 2017 00:53
agk just using a struct as a memoryblock with default values, so integer =0 float = 0.0 string link to ""
other way, using ix as content and fill the list only with filled data. its different, access by row/column is more common and works without search.

this will make a copy, if you not want maybe just memory the index here.
tileArray[ix].piece = player_pieces[drag_piece_id].piece

and btw agk support the ref (by reference) in function arguments



AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)

Login to post a reply

Server time is: 2024-11-24 20:42:52
Your offset time is: 2024-11-24 20:42:52