Data editing > Using subroutines in the edit > Writing your own routines > Writing subroutines in Quantum > Arguments
 
Arguments
Generally, subroutines only need arguments when you are passing the values of local edit variables to the subroutine. All arguments on the call statement must have a corresponding argument of the same type on the subroutine statement. This is because Quantum does not compare the names of the arguments on the call and subroutine lines. It passes the value of the first argument given with call to the first argument named with subroutine and so on. For example, if gallons and liters are local edit variables and you want to use their values in the subroutine calc, write:
int gallons 1s
real liters 1s
ed
call calc(gallons,liters)
      .
subroutine calc(input,output)
int input
real output
Here, the value of gallons is passed to input while the value of liters is passed to output. Input and output are variables used solely within the subroutine so they are defined in the subroutine.
See also
Writing subroutines in Quantum