Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 770 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
numbers from command line #482400
02/01/21 19:53
02/01/21 19:53
Joined: Aug 2020
Posts: 59
London
Neb Offline OP
Junior Member
Neb  Offline OP
Junior Member

Joined: Aug 2020
Posts: 59
London
Hi,

I tried to pass numbers to zorro script from the command line:

c:\users\zorro\zorro.exe -run -h Workshop4.c -i "100" -i "200" -i "300" and also before with
c:\users\zorro\zorro.exe -run -h Workshop4.c -i 100 -i 200 -i 300

In script Workshop4.c I am just trying to print as:

// Trend Trading ///////////////////
#include <profile.c>

var Promenljiva1 = Command[0];
var Promenljiva2 = Command[1];
var Promenljiva3 = Command[2];
printf("\nPromenljiva1: %d ",(var)Promenljiva1);
printf("\nPromenljiva2: %d ",(var)Promenljiva2);
printf("\nPromenljiva3: %d ",(var)Promenljiva3);


function run()
{

In both ways seems I am not passing argument through.
Can you, please, help ?

Thanks in advance !

Neb

Re: numbers from command line [Re: Neb] #482402
02/02/21 07:32
02/02/21 07:32
Joined: Aug 2020
Posts: 59
London
Neb Offline OP
Junior Member
Neb  Offline OP
Junior Member

Joined: Aug 2020
Posts: 59
London
Hi,

Same question, when I am adding strings, with -u option, how I am passing by to script:

For instance for this:
c:\users\zorro\zorro.exe -run Workshop4.c -h -i 100 -i 200 -i 300 -u "Ivy" -u "gmail"

Tried few things, with report() and report[], did not help.

Thanks,

Neb

Last edited by Neb; 02/02/21 07:36.
Re: numbers from command line [Re: Neb] #482403
02/02/21 07:35
02/02/21 07:35
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
try this:
int Promenljiva1 = Command[0];
int Promenljiva2 = Command[1];
int Promenljiva3 = Command[2];

Passes an integer number to the script (Zorro S only) that can be read through the Command variable. Up to 4 numbers can be transferred to the script, each preceded by "-i". This way, the same script started with the command line can behave in different ways.

Last edited by Grat; 02/02/21 07:35.
Re: numbers from command line [Re: Neb] #482405
02/02/21 08:57
02/02/21 08:57
Joined: Aug 2020
Posts: 59
London
Neb Offline OP
Junior Member
Neb  Offline OP
Junior Member

Joined: Aug 2020
Posts: 59
London
Yeees,

How short sighted I am laugh
Thanks @Grat !!!!!

Neb


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1