Gamestudio Links
Zorro Links
Newest Posts
MRC.c and WFO
by 11honza11. 11/18/25 15:22
webGL
by Ice2642. 11/17/25 21:27
Camera always moves upwards?
by NeoDumont. 11/17/25 09:56
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, 1 invisible), 16,939 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
SkinnyApe, tritom, sheliepaley, Blueguy, blobplayintennis
19179 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how do you initialize a multi-dimensional array? #147736
08/13/07 20:30
08/13/07 20:30
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
In the manual it says to initialize an array:
var name[n] = { value_1, value_2, ... value_n };

but what about a multidimensional array?
As an example, I've tried both:

var array[2][2] = {1, 2 ,3, 4};

and

var array[2][2] = {{1, 2},{3,4}};

which is how it's done in C, but neither compiles (syntax error) in Lite_C.
Any ideas?

Re: how do you initialize a multi-dimensional arr [Re: yorisimo] #147737
08/15/07 14:09
08/15/07 14:09
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Has no one done this?!


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: how do you initialize a multi-dimensional arr [Re: yorisimo] #147738
08/15/07 15:13
08/15/07 15:13
Joined: Apr 2005
Posts: 67
InnerSpace
dudeBot Offline
Junior Member
dudeBot  Offline
Junior Member

Joined: Apr 2005
Posts: 67
InnerSpace
I'm not sure about liteC, but I do know that cScript
does not allow mutli-dimensional arrays.

check this post out:
http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/776842/an/0/page/0#Post776842

You may already know this stuff, but this thread talks about
how to manage a singe dimensional array as if it a mutli-dimensional array.

If you don't know this stuff, check out my last post in the thread.
It has a link to some cScript with funcitons created to initialize
the array, as well error-checking "get" and "set" functions.

I think that it should be little effort if any, to "port" the cScript
over to liteC.

Re: how do you initialize a multi-dimensional arr [Re: yorisimo] #147739
08/15/07 17:48
08/15/07 17:48
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
@yorisimo: this isn't supported by the compiler, but will be implemented in the future. In the meantime you could use a startup function to initialize it

Last edited by HeelX; 08/15/07 17:48.

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