Besonderhede van voorbeeld: -8953838624694853431

Metadata

Author: Common crawl

Data

English[en]
Before using goto, first you have to declare a label and precede the sentence where you want to jump to by this label followed by a colon, as in the following example: function IsCharInString(char c, string s): boolean; var i, n: Integer; label CharFound; begin n := Length(s); for i := 1 to n do if s[i] = c then goto CharFound; Result := False; Exit; // Ends a procedure or function CharFound: Result := True; end; Never use goto to jump into a loop or other structured statement, since this can have unpredictable effects.
Spanish[es]
Antes de usar goto, primero debe declarar una etiqueta y preceder la sentencia donde desea saltar por esa etiqueta seguida de dos puntos (":"), como en el siguiente ejemplo: function EstaCaracterEnCadena(char c, string s): boolean; var i, n: Integer; label CaracterEncontrado; begin n := Length(s); for i := 1 to n do if s[i] = c then goto CaracterEncontrado; Result := False; Exit; // Sale de un procedimiento o función CaracterEncontrado: Result := True; end; Nunca usa goto para saltar hacia adentro de un bucle u otra sentencia estructurada debido a que puede producir efectos impredecibles.

History

Your action: