Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
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
0 registered members (), 18,175 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
extern static array of structs #470560
01/21/18 06:15
01/21/18 06:15
Joined: Dec 2014
Posts: 206
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 206
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: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
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: 206
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 206
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 | 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