Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,618 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 5 1 2 3 4 5
Re: I need some outsider's perspective... [Re: Carlos3DGS] #417330
02/11/13 16:27
02/11/13 16:27
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Don't forget the operator precedence!
Code:
(MAP.TILES)[ty] = [...]



Always learn from history, to be sure you make the same mistakes again...
Re: I need some outsider's perspective... [Re: Uhrwerk] #417338
02/11/13 18:26
02/11/13 18:26
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
thanks alot!

So for this new version I now need an extra set of parenthesis?
What about writing into the array?

Code:
((MAP.TILES)[tx])[ty]=blablabla;
(MAP.TILES[tx])[ty]=blablabla;
(MAP.TILES[tx][ty])=blablabla;
(((MAP.TILES)[tx])[ty])=blablabla;


All of these variations produce errors...

EDIT:
Nevermind, I was not thinking properly.
For anyone doing something similar in the future the correct syntax would be:
Code:
((MAP.TILES)[tx])[ty].highID=blablabla;


It is hard getting used to using arrays like this, but hopefully in time I will stop making these stupid mistakes...
Thankyou all for your help!

Last edited by Carlos3DGS; 02/11/13 18:33.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: I need some outsider's perspective... [Re: Carlos3DGS] #417339
02/11/13 18:33
02/11/13 18:33
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
If you really want to benefit from this stuff then you should use PRAGMA_POINTER. This way you can learn it the way it is in c.


Always learn from history, to be sure you make the same mistakes again...
Re: I need some outsider's perspective... [Re: Uhrwerk] #417340
02/11/13 18:39
02/11/13 18:39
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I have never used pragma_pointer before
How would it be with Lite-C pointer autodetection deactivated?
Code:
&(&(MAP->TILES)[tx])[ty]->highID=43;


Would this be correct?
Is there a simpler way?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Page 5 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1