Команды SFK


    1        2        3        4        5        6        7        8        9        10    

Раздел 7. Scripting - Скрипты
alias | batch | call | cd | clock | color | echo | for | getcwd | label | loop | mkcd | pause | require | setvar | sleep | stop | storetext | tee | time | tofile | toterm |

Help:   Рус   |   Eng        

Команда: for
sfk for variable from start to end [step n]

   repeat sfk commands several times, from a start
   value until an end value, setting a variable.

   command chaining notes
      for must be followed by another chain command.
      the command sequence to repeat must end with +endfor.
      +for can be nested up to 5 times. further +for must
      be put into a sub function called by +call.

   see also
      sfk perline   do something per chain text line

   examples
      sfk for i from 1 to 10 +echo -var "#(i)" +endfor
         print numbers 1 to 10.
      sfk -var for i from 5 to -5 step -3 +echo "#(i)" +endfor
         print numbers 5 to -4. the -5 is not reached.
      sfk -var for i from 1 to 20
       +copy -ltarg mydir\in#(i).jpg mydir2\out#(02i).jpg +endfor
         copy from mydir files in1.jpg, in2.jpg in3.jpg etc.
         to mydir2 as out01.jpg, out02.jpg, out03.jpg, showing
         the target filenames. add -yes after copy to confirm.