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 / Calculate problem with variable

Author
Message
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 2nd Mar 2015 13:17
hi all
I have a problem, broke all head:
g_tMapChar.CashMap[x, y].Pt.S = 114
print(g_tMapChar.CashMap [x, y].Pt.S) - Printing `114`

g_tMapChar.CashMap[x, y].Pt.S = g_tMapChar.CashMap[x, y].Pt.S + 256
print(g_tMapChar.CashMap[x, y].Pt.s) - Printing `339`

must be 370


I do not understand what is happening.

HEEEELP!

AGK 2 !
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 2nd Mar 2015 13:37
or here:
g_tMapChar.CashMap [x, y] .Pt.Y = 852
g_tMapChar.CashMap [x, y] .Pt.Y = g_tMapChar.CashMap [x, y] .Pt.Y + 0
print (g_tMapChar.CashMap [x, y] .Pt.Y) - printing `854`

wtf? !!!

AGK 2 !
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Mar 2015 14:24
Can you post an example that can be compiled and run? There are 2 possible problems:
1-There is a bug in AppGameKit that nobody can find without a working example
2-There is a bug in your code that nobody can find without a working example


Using AppGameKit V2 Tier 1
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 2nd Mar 2015 15:40
Working Code is biggest.
Place where this strange behavior looks that way.
It began with the fact that the IDE no longer understand the contents of the variable type Pt (X, Y as integer) - tried to slip the other variables of another type.

AGK 2 !
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 8th Mar 2015 11:26
the problem was the following:
Function CreateTile (...)
variables ...
...
Tile as t_Tile
...
Tile.Name = GenerateTileName (lon, lat)

Endfunction

Function GenerateTileName (lon, lat)
variables
...
Tile as t_Tile
...
Endfunction stringName

Compiler for some reason was unable to name the same user-defined type variables, despite the fact that in the called function, this variable is not even used.
Once I removed the declaration of variables in GenerateTileName () problem immediately ended.

Now I have an optimized version of the program management couriers.

AGK 2 !

Login to post a reply

Server time is: 2024-05-18 18:28:34
Your offset time is: 2024-05-18 18:28:34