Excel - 巨集
程式代碼:
Private Sub CommandButton1_Click()
For i = 1 To 10
Cells(1, i) = i
Next i
End Sub
java
程式代碼:
class Test
{
public static void main(String[] args)
{
System.out.println("1");
System.out.println("2");
System.out.println("3");
System.out.println("4");
System.out.println("5");
System.out.println("6");
System.out.println("7");
System.out.println("8");
System.out.println("9");
System.out.println("10");
}
}
JavaScript
程式代碼:
<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("1 2 3 4 5 6 7 8 9 10");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>
JavaScript
程式代碼:
<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("1*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=9<br>");
document.write("<br>");
document.write("2*1=1 2*2=2 2*3=3 2*4=4 2*5=5 2*6=6 2*7=7 2*8=8 2*9=9<br>");
document.write("<br>");
document.write("3*1=1 3*2=2 3*3=3 3*4=4 3*5=5 3*6=6 3*7=7 3*8=8 3*9=9<br>");
document.write("<br>");
document.write("4*1=1 4*2=2 4*3=3 4*4=4 4*5=5 4*6=6 4*7=7 4*8=8 4*9=9<br>");
document.write("<br>");
document.write("5*1=1 5*2=2 5*3=3 5*4=4 5*5=5 5*6=6 5*7=7 5*8=8 5*9=9<br>");
document.write("<br>");
document.write("6*1=1 6*2=2 6*3=3 6*4=4 6*5=5 6*6=6 6*7=7 6*8=8 6*9=9<br>");
document.write("<br>");
document.write("7*1=1 7*2=2 7*3=3 7*4=4 7*5=5 7*6=6 7*7=7 7*8=8 7*9=9<br>");
document.write("<br>");
document.write("8*1=1 8*2=2 8*3=3 8*4=4 8*5=5 8*6=6 8*7=7 8*8=8 8*9=9<br>");
document.write("<br>");
document.write("9*1=1 9*2=2 9*3=3 9*4=4 9*5=5 9*6=6 9*7=7 9*8=8 9*9=9<br>");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>
沒有留言:
張貼留言