Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | chip programmers | 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