File : random.cgi
#!/usr/local/bin/spar
pragma annotate( summary, "random.cgi" );
pragma annotate( description, "Display a random number when the page is loaded" );
pragma annotate( author, "Ken O. Burtch" );
pragma license( unrestricted );
random_number : positive := numerics.rnd(100);
-- display the results using this template
pragma template( html, "random.tmpl" );
<!-- random.tmpl: Display a random number when the page is loaded -->
<html>
<head>
<title>random.cgi example</title>
</head>
<body>
<h1>Your random number between 1 and 100 is</h1>
<p><?spar ? random_number; ?></p>
</body>
</html>