Another delay topic

Hi everybody, I’m sorry for another „delay“ topic, but after I have read all about it here on forum, I’m totally confused – my programing skills are poor. Is someone willing to write me example code to avoid delay for this case:

void setup()
{
  pinMode(gatepin, OUTPUT);      
}

void loop()
{
If (some action)  {
digitalWrite(gatePin, HIGH);  
  delay(800);                          // needed lenght of HIGH
  digitalWrite(gatePin, LOW);    
}
}

I need a simple timer: After "some action" pin goes High for some adjusted time (0,8 second in my case), and after goes low - no repeating, until "some action" comes again . That is the best way to do this instead of delay?
Thanks a lot, and sorry for Dummie question.

You didn't say what the 'some action' is. If it is a button press then this code will repeat if the button is held down. There are ways to deal with this but here is something to try with regard to the delay.

const byte gatepin = whatever you want;
unsigned long startTime;
unsigned long interval = 800;

void setup()
{
  pinMode(gatepin, OUTPUT);      
}

void loop()
{
  if (some action)  
  {
    digitalWrite(gatePin, HIGH);  
    startTime = millis();                //save the start time
  }

  if (millis() - startTime >= interval)  //test if required time has elapsed
  {
    digitalWrite(gatePin, LOW);    
  }
}

Thanks HeliBob,
Some action is String reading:

          client.print("<a href='GON'data-role='button'data-inline='true'data-transition='flip'>Open/Close</a>");
          if (query.indexOf("GON") > 0) {    
              digitalWrite(gatepin, HIGH);
...

OK. As written, if the trigger event happens again during the ‘delay’ then the ‘delay’ will start again. There are ways round this if necessary by flagging that the ‘delay’ is happening and ignoring the trigger event until the ‘delay’ is finished.