Template:Code:Valid

From Wikibooks, open books for an open world
Jump to: navigation, search
Crystal Clear action apply.png {{{1}}}
{{{2}}}
{{{3}}}
Template documentation[edit] [history] [purge]

Usage[edit]

This template is used to display a code that is at least syntactically valid.

Examples[edit]

The following call

{{Code:Valid|The code
 <source lang="perl">
   my @array = qw(one two three);
 
   print "Array contains " . @array . " element" . ((@array == 1) ? "" : "s") . "\n";
   </source>|
 returns the following:|
   Array contains 3 elements
}}

displays a perl code that is valid:

Crystal Clear action apply.png The code
my @array = qw(one two three);

print "Array contains " . @array . " element" . ((@array == 1) ? "" : "s") . "\n";
returns the following:
Array contains 3 elements


See also[edit]