Al followed by an infinitive is usually the approximate equivalent of "upon," "on" or "when" followed by the gerund (the "-ing" form of a verb) in English.
Here are some examples of this usage:
- El diagnóstico se hace al encontrar que hay dolor. (The diagnosis is done upon finding that there is pain.)
- Hay error al enviar mensajes desde mi programa de correo. (There is an error when sending messages from my email program.)
- Lea en la mañana al despertarse; lea en la noche al acostarse. (Read in the morning on getting up; read in the evening when going to bed.)
- Al comprar una empresa, la consideración más importante es sus aspectos económicos. (When buying a business, the most important consideration is its economic aspects.)
- Me puse nervioso al ver la osa con su cría. (I became nervous upon seeing the bear with her cub.)
- Al escuchar el himno nacional todas las personas quitarán el sombrero. (On hearing the national anthem, all the people will take off their hats.)
- Hay error al enviar mensajes desde mi programa de correo. (I get an error when I send messages from my email program.)
- Me puse nervioso al ver la osa con su cría. (I became nervous when I saw the bear with her cub.)

