numbers from command line

Posted By: Neb

numbers from command line - 02/01/21 19:53

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
Posted By: Neb

Re: numbers from command line - 02/02/21 07:32

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
Posted By: Grat

Re: numbers from command line - 02/02/21 07:35

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.
Posted By: Neb

Re: numbers from command line - 02/02/21 08:57

Yeees,

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

Neb
© 2024 lite-C Forums