How to call a function of one module in another module How can I call a function of one module in another module? I want to call uc_stock_adjust() function of uc_stock.module in my own custom module. Is it possible? 

Here is my code so far:

function my_module_node_presave($node){ 
  if($node-&gt;type == 'add_stock') { 
    $stock_value = $node-&gt;field_stock_value['und'][0]['value']; 
    $sku = $node-&gt;field_sku['und'][0]['value']; 
    if (module_exists('uc_stock') &amp;&amp; function_exists('uc_stock_adjust')) {
      uc_stock_adjust($sku, $stock_value); 
    } 
  } 
}   


I want to add and delete stock of products by using reference uc_stock_adjust(), which is defined in uc_stock.module, in my custom module. But when I try the above code, it doesn't work.

It giving an error, and the error is: 


  Notice: Undefined variable: sku in my_module_node_presave() (line 29 of \sites\all\modules\my_module\my_module.module)‌​
To call the function of one module in another module:


If the function is not in the .module file, call module_load_include()

//Load node.admin.inc from the node module
module_load_include('inc', 'node', 'node.admin');

Call the function from the other module

function_you_want_to_call();