Purpose of using sub routines over functions

后端 未结 7 1156
抹茶落季
抹茶落季 2021-02-07 07:38

I\'ve been working with Access for a while now, and although I understand the obvious benefit of a Function over a Sub, been that it can return values as a result, I\'m not sure

7条回答
  •  北海茫月
    2021-02-07 08:16

    The main difference is not only the return value, it seems that subs are faster than functions (at least in .net) because the MSIL code of subs is much shorter when no value is returned. so overall subs are faster when no value is returned. oh i've just found a great source for it (talks about .net), maybe you would like to read further about it- Functions vs. Subroutines

提交回复
热议问题