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 / Declaring Variables

Author
Message
XanthorXIII
AGK Gold Backer
13
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 27th Aug 2011 08:50
When I attempt to declare a variable such as

the value always comes out to be 0. Is it not possible to calculate a value when declaring a variable?
Thraxas
Retired Moderator
18
Years of Service
User Offline
Joined: 8th Feb 2006
Location: The Avenging Axe, Turai
Posted: 27th Aug 2011 08:55
I don't know the answer to your question, but I would like to know why you need to declare a variable in this way?

XanthorXIII
AGK Gold Backer
13
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 27th Aug 2011 17:15 Edited at: 27th Aug 2011 17:16
It's not that I need to declare it as 14-1, but I need to insert variables into it so it will calculate the values at run time.
For example, this code works and gives me the correct result of 13.


While this code gives me 0.


I'm trying to stick to a style of coding and that's not working out as much as I would like.
Josk
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location:
Posted: 27th Aug 2011 17:28
Try
XanthorXIII
AGK Gold Backer
13
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 27th Aug 2011 17:30
I know that works. It's the whole
arraySize as integer = numberOfItems-1
that doesn't work.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 30th Aug 2011 02:57
This works.

I think it is just trying to cheat, and use one line that is the problem

MobileCreator
13
Years of Service
User Offline
Joined: 1st Jun 2011
Location: Ottawa - Canada
Posted: 30th Aug 2011 04:09
I don't think you can declare the variable and set a value at the same time, like you do in C, for example

Cheers

----------
Paulo
http://www.mobilecreators.com

Login to post a reply

Server time is: 2024-11-21 18:05:41
Your offset time is: 2024-11-21 18:05:41