cvs: phpdoc /cs/language control-structures.xml

From: Date: Thu, 28 Mar 2002 23:17:48 +0000
Subject: cvs: phpdoc /cs/language control-structures.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969343743@lists.php.net to get a copy of this message
luk Thu Mar 28 18:17:48 2002 EDT Modified files: /phpdoc/cs/language control-structures.xml Log: Index: phpdoc/cs/language/control-structures.xml diff -u phpdoc/cs/language/control-structures.xml:1.1 phpdoc/cs/language/control-structures.xml:1.2 --- phpdoc/cs/language/control-structures.xml:1.1 Mon Mar 25 18:07:15 2002 +++ phpdoc/cs/language/control-structures.xml Thu Mar 28 18:17:48 2002 @@ -178,44 +178,45 @@ </informalexample> </para> <simpara> - In the above example, the HTML block "A = 5" is nested within an - <literal>if</literal> statement written in the alternative syntax. - The HTML block would be displayed only if $a is equal to 5. + Ve vý¹e uvedeném pøíkladu je HTML blok vnoøen do konstruktu + <literal>if</literal> napsaném alternativní syntaxí. + Tento HTML blok by se zobrazil pouze v pøípadì, ¾e je $a rovno 5. </simpara> <para> - The alternative syntax applies to <literal>else</literal> and - <literal>elseif</literal> as well. The following is an - <literal>if</literal> structure with <literal>elseif</literal> and - <literal>else</literal> in the alternative format: + Alternativní syntaxi lze pou¾ít i pro <literal>else</literal> a + <literal>elseif</literal>. Následující pøíklad ukazuje strukturu + <literal>if</literal>, <literal>elseif</literal> a + <literal>else</literal> v alternativním formátu: <informalexample> <programlisting role="php"> <![CDATA[ if ($a == 5): - print "a equals 5"; + print "a se rovná 5"; print "..."; elseif ($a == 6): - print "a equals 6"; + print "a se rovná 6"; print "!!!"; else: - print "a is neither 5 nor 6"; + print "a není ani 5, ani 6"; endif; ]]> </programlisting> </informalexample> </para> <para> - See also <link linkend="control-structures.while">while</link>, - <link linkend="control-structures.for">for</link>, and <link - linkend="control-structures.if">if</link> for further examples. + Dal¹í pøíklady - viz také + <link linkend="control-structures.while">while</link>, + <link linkend="control-structures.for">for</link>, a <link + linkend="control-structures.if">if</link>. </para> </sect1> <sect1 id="control-structures.while"> <title><literal>while</literal></title> <para> - <literal>while</literal> loops are the simplest type of loop in - PHP. They behave just like their C counterparts. The basic form - of a <literal>while</literal> statement is: + Cykly <literal>while</literal> jsou nejjednodu¹¹ím typem cyklù v PHP. + Chovají se jako jejich protìj¹ci v C. Základí formát konstruktu + <literal>while</literal> je tento: <informalexample> <programlisting> <![CDATA[ @@ -225,17 +226,15 @@ </informalexample> </para> <simpara> - The meaning of a <literal>while</literal> statement is simple. It - tells PHP to execute the nested statement(s) repeatedly, as long - as the <literal>while</literal> expression evaluates to - &true;. The value of the expression is checked - each time at the beginning of the loop, so even if this value - changes during the execution of the nested statement(s), execution - will not stop until the end of the iteration (each time PHP runs - the statements in the loop is one iteration). Sometimes, if the - <literal>while</literal> expression evaluates to - &false; from the very beginning, the nested - statement(s) won't even be run once. + Význam konstruktu <literal>while</literal> je snadno pochopitelný. + Øíká PHP, ¾e má provádìt vnoøený(é) konstrukt(y) tak dlouho, dokud je + výraz ve <literal>while</literal> roven &true;. Hodnota výrazu je testována + poka¾dé na zaèátku cyklu (v ka¾dé iteraci), tak¾e i kdy¾ se tato hodnota + bìhem provádìní vnoøených konstruktù zmìní, provede se zbytek kódu uvnitø + cyklu - v konkrétní iteraci - a¾ do konce (ka¾dé provedení kódu uvnitø + cyklu je jedna iterace). Nìkdy, kdy¾ je výraz ve + <literal>while</literal> ohodnocen jako &false; ji¾ pøi vstupu do cyklu, + vnoøený kód se neprovede vùbec. </simpara> <para> Like with the <literal>if</literal> statement, you can group

« previous php.doc (#969343743) next »