Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
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
6 registered members (TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible), 17,843 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
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