Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, EternallyCurious, Petra, 1 invisible), 795 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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