Команды 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        

Команда: call
sfk ... +call label [parm1 parm2 ...]

   call a sub function in the current script,
   starting at the given label.

   chaining input control
      by default, "call" does not consume or pass
      through text input from previous commands.
      use +tcall to expect text input,
      use +fcall to expect file list input.

   recursion limit
      if the called function calls another function
      by call or perline this should not be nested
      too often, otherwise sfk may crash.

   see also
      sfk samp sfkbat   script example
      sfk stop          stop a function with rc
      sfk if            conditional execution
      sfk stacksize     test available stack size

   examples
      --- file script.txt begin ---
      sfk label begin
         +echo "script starts"
          +call mysub in.txt foo
         +echo "all done"
         +end

      sfk label mysub
         +filter %1 -justrc -+%2
            +if "rc=0" stop 9 "[Red]miss[def]"
         +echo "found"
         +end
      --- file script.txt end ---

      sfk script script.txt
        searches input file in.txt for word "foo".
        if not found, prints "miss" and stops the script.
        note that stop return code 9 or higher is required
        to stop further execution after "call".