Les 2 auteurs
L'article
Date de publication : 11/04/2012
Date de mise à jour : 11/04/2012
Niveau : Débutant à expert
Durée : 30 minutes
III. Exemple de coloration des codes
III-A. CSS
/* définition du style de la police, et largeur du select */
select {
font-family : Courier ;
font-size : 10px ;
width : 200px;
}
/* élément de couleur bleu */
option.bl_eu
{
color : #0000FF ;
background-color :#00CCFF ;
background : blue url(img.png) ;
background-color : blue ;
background-image : url(img.png) ;
}
III-B. Delphi et Delphi pour .NET
// commentaire
{
Un commentaire sur
plusieurs lignes }
{$ une directive }
Var i:Integer;
<a href="lien.html?parametre1=valeur1&parametre2=valeur2">test</a>
(*
Et un autre
*)
begin
For i:=Onglet.PageCount-1 DownTo 0 Do
Begin
Onglet.ActivePageIndex:=i;
// En commentaire d ON ' euuuuuu
ShowMessage('Truc muche !'kqjhsd'jhkjh''''''hghg''''hg'); // c'est un comment !
{ et un autre }
FileName:= 'Document.doc'; // ou 'Document.rtf'
URL ='http://toto.com';
End;
end;
III-C. JAVA
// un comment en deb
public class MaClasse{
public static Map uneVariableStatique = new HashMap();
static{
/* uneVariableStatique.put("une clef","une valeur");
uneVariableStatique.put("une autre clef","une autre http:// jshdjshd");*/
//etc un comment et import
uneVariableStatique.put("une clef","une http://valeur");
uneVariableStatique.put("une autre clef","une autr\"e valeur\\\"");
qal.declareImports("import com.unilog.data.Track");
import toto;
}
}
III-D. Perl
#!/usr/bin/perl
use strict;
use warnings;
# Voici une ligne de commentaire.
print "Bonjour\n"; # Affichage du mot bonjour (autre commentaire).
III-E. PHP
function creationPanier(){
if (!isset($_SESSION['panier'])){
$_SESSION['panier']=array();
$_SESSION['panier']['libelleProduit'] = array();
$_SESSION['panier']['qteProduit'] = array();
$_SESSION['panier']['prixProduit'] = array();
$_SESSION['panier']['verrou'] = false;
}
return true;
}
III-F. XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<xiti>
<!-- compteur Dotnet-->
<alias>Dotnet</alias>
<logg_er>logv99</logg_er>
<id>12345</id>
</xiti>
</document>


