在Shell中,调用函数时可以向其传递参数.在函数体内部,通过 $n 的形式来获取参数的值,例如,$1表示第一个参数,$2表示第二个参数... 带参数的函数示例: #!/bin/bash funWithParam(){ echo "The value of the first paramter is $1!" echo "The value of the second paramter is $2!" echo "The value of the tent
在Shell中,调用函数时可以向其传递参数.在函数体内部,通过 $n 的形式来获取参数的值,例如,$1表示第一个参数,$2表示第二个参数... 带参数的函数示例: #!/bin/bash funWithParam(){ echo "The value of the first parameter is $1 !" echo "The value of the second parameter is $2 !" echo "The value of the
在函数中如果数组的个数不定,可以使用开放数组参数 实参可以接受静态数组和动态数组 procedure p1(a:array of Byte); begin ShowMessage( IntToHex( Integer(@a),2)); ShowMessage(IntToStr(a[0])); end; procedure TForm1.btn1Click(Sender: TObject); var a:array[0..5] of Byte; begin ShowMessage(IntToHex