Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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 | 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