Programming advise

Hello,
I have configured the SendSMS as a function.
if I want to send SMS to multiple recipients once an event is happened, which is better:
1- add for loop starting at 0 until the maximum number of recipients, and inside the for loop add the SendSMS function, OR
2- create a bool variable for example SendingSMSInProcess, and its value will be TRUE once the event is happened and call the SendSMS function without for loop and once the SMS sent to the last recipient, change the SendingSMSInProcess to false

thanks

There is little to choose between the two approaches unless you want the Arduino to be able to attend to other things while the messages are being sent in which case the second approach is required. For example if you want a user to be able to press a button to abort the process.

...R

Robin2:
There is little to choose between the two approaches unless you want the Arduino to be able to attend to other things while the messages are being sent in which case the second approach is required. For example if you want a user to be able to press a button to abort the process.

...R

Yes, for my case, no since it is important to alert for that event and after continue the normal process.
So, it depends what the solution is!

thank you