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 / AGK2 What happened to NIL value?

Author
Message
Alebrije
11
Years of Service
User Offline
Joined: 27th May 2013
Location: Toluca
Posted: 10th Nov 2015 19:17
Hello everyone at the AppGameKit community. I was a V2 pledger and got access to this great software. I have a project I created in the V1. In that project there used to be a NIL value, to set a variable to NULL. In V2, the compiler does not recognize NIL or NULL. I have been unable to find what happened to the value or what new keyword to use. Could you give me a hint on this?

Sorry if this has been asked already, I couldn't find it on the forums either.

Greetings
Classics games, modern wonders

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Nov 2015 21:48 Edited at: 10th Nov 2015 21:54
integers have only values, means NULL did not exist but 0 as default value.
its not object orientated in tier1 basic.
AGK (Steam) V2.0.15c : Windows 10 Pro 64 Bit : AMD (15.201.1151.0) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Nov 2015 09:29
Yep, no null value in AppGameKit, it was just initializing a new value and storing 0 in it. I believe AGK2 complains about un-initialised variables.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Nov 2015 08:46
I can confirm what Mobiius says.
To fix it in your code, just add one line at the start:

nil = 0

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 17th Nov 2015 15:28
Yeah, AppGameKit has never used a NULL value. All integer and float variables are 0 by default and strings are "". If you don't want to use that then I suggest BatVink's idea, but use a constant declaration instead.
Alebrije
11
Years of Service
User Offline
Joined: 27th May 2013
Location: Toluca
Posted: 17th Nov 2015 22:48 Edited at: 17th Nov 2015 22:48
I guess I have to change the source code as suggested. Thanks a lot for all of your comments.
Classics games, modern wonders

Login to post a reply

Server time is: 2024-11-17 00:21:26
Your offset time is: 2024-11-17 00:21:26