Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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