Car Alarm - Delay

Hi,

I am attempting to build a car alarm system for my car which does not currently have an alarm. I have been working on it today but am stuck with a few things. In a previous version of the Arduino IDE I was able to setup a function similar to below:

void functionname (variable1, variable2)
// some code
return variable1;

However now I get the error variable or field "" declared void.

My second issue is once the alarm has triggered I only want the alarm to sound the siren and flash the indicators for 5 minutes whilst at the same time checking if my wireless remote has turned the alarm off again. I have got most parts working but I have realised that I cannot use the delay() function as it stops all other actions.

Thanks in advanced.

Declaring your function "void" tells the compiler that your function will not be returning anything.
if you want to return something you need to tell it what type of variable you want to return.
e.g. int functionName() or byte functionName().

see blink without delay and several things at the same time to learn how to avoid using delay().
Edit: here is another good one- multi tasking the arduino

You want to do something like this:

digitalWrite(alarm, HIGH);
unsigned long stoptime = millis() + 300000; // current plus 5 minutes
if (millis() > stoptime) {
  digitalWrite(alarm, LOW); 
}

You have to work the code into your existing code somehow.

Why are you returning an input variable?