Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 972 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
extern static array of structs #470560
01/21/18 06:15
01/21/18 06:15
Joined: Dec 2014
Posts: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
Germany
I wrote an indicator which holds data in a static struct array.

It's very complex code so I packed it into a function in an external source file for convenience reasons.

The function returns an index. Now I want to make the array a global variable so that I can just call

Code:
MyArray[Indexfunction(some params)]


from within the trading script.

However, declaring

Code:
extern static STRUCT MyArray[100];



or even

Code:
static extern STRUCT MyArray[100];



results in a syntax error.

Is it even possible what I'm trying to do here?

Re: extern static array of structs [Re: Smon] #470563
01/21/18 17:20
01/21/18 17:20
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
I am pretty sure that lite C has no linker, so "extern" wont work.

Re: extern static array of structs [Re: Spirit] #470572
01/22/18 09:36
01/22/18 09:36
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Correct, it has no linker.

Re: extern static array of structs [Re: jcl] #470595
01/23/18 19:33
01/23/18 19:33
Joined: Dec 2014
Posts: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
Germany
It seems, that I don't need to use "extern", as "static" already makes a variable global. I will give this a try!
Thx!

Re: extern static array of structs [Re: jcl] #475724
01/05/19 07:02
01/05/19 07:02
Joined: Apr 2017
Posts: 106
3
3dgamelight Offline
Member
3dgamelight  Offline
Member
3

Joined: Apr 2017
Posts: 106
Lite-C have a linker. If not it wouldn't be possible to compile dlls or run Lite-C programs without some program that jumps to the Lite-C code.

"Creating dynamic link libraries 100%"
http://manual.3dgamestudio.net/forecast.htm


Moderated by  Petra 

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