title: Can a function in Solidity call another function within the contract?
body: <p>I'm totally new to programming and I'm trying to code a Smart Contract that can receive funds and transfer them to other addresses through a function.
  In my code I have a modifier that defines an owner that can call the withdraw/transfer function. I have defined 3 address variables, where the function transfers ETH to. Luckily it works as I want it to.</p>
  <pre><code>pragma solidity ^0.7.0;
  
  contract SubscriptionPayment {
  
  // address variable defining the owner 
  address public owner = msg.sender
  ;
  
  // modifier that restricts access to the owner of contract
  modifier onlyOwner{
      require(msg.sender == owner);
  _;
  }
  // contract is able to handle ETH
  receive() external payable{
  }
  
  // function to withdraw restricted to owner 
  function withdraw(uint _value) external onlyOwner {
      msg.sender.transfer(_value)
  ;
  }
  
  // define address variables 
  address payable public account1Address = 0xF6D461F87BBce30C9D03Ff7a8602156f006E2367 ;
  address payable public account2Address = 0xb6a76127EDf7E0B7dfcEd9aDE73Fa8780eC26592 ;
  address payable public account3Address = 0x722b95CA56b1C884f574BAE4832f053197Ca3F58 ;
  
  // function to pay all subscriptions
  function paySubscriptions() external onlyOwner {
      account1Address.transfer(1000000000000000000);
      account2Address.transfer(1000000000000000000);
      account3Address.transfer(2000000000000000000);
  }
  </code></pre>
  <p>My question concerns the paySubscriptions function. Is there any way to execute the transfers to these 3 addresses individually and sequentially? Of course I could just make 3 separate functions to transfer ETH to each of these addresses but that would give me 3 separate functions to call.
  Is it possible to code that when one function is called, another one is called from within the contract and when this function is called, another one is called from within the contract? If so, I could code one function1 that can be called external and the other 2 functions are called from within the contract after function1 has been called/executed.</p>