Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 923 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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