Wiki source for SyntaxDiff


Show raw source

""<table cellspacing="1" cellpadding="5" bgcolor="#666666">
<tr bgcolor="#FFFFFF">

<th bgcolor="#666666" height="41" width="10">
<pre>
</pre>
</th>
<th bgcolor="#CC3300" height="41" width="212"><b>old BASIC syntax</b><br>
QBASIC, GWBASIC</th>
<th bgcolor="#CC3300" height="41" width="161"><b>VisualBasic, VBA</b></th>
<th bgcolor="#CC3300" height="41" width="203"><b>C, C++</b></th>

<th bgcolor="#CC3300" height="41" width="294"><b>Java</b></th>
<th bgcolor="#CC3300" height="41" width="245"><b>Java-Script</b></th>
<th bgcolor="#CC3300" height="41" width="196"><b>PHP</b></th>
<th bgcolor="#CC3300" height="41" width="189"><b>BASH</b></th>
<th bgcolor="#CC3300" height="41" width="98"><b>MATLAB, OCTAVE</b></th>
<th bgcolor="#CC3300" height="41" width="245"><b>8086 Assembler (nasm)</b></th>

</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#009933" width="10"><b>comments</b></td>
<td width="212">
<pre>
REM Comment
</pre>
</td>
<td width="161">

<pre>
Rem Comment

' Another comment</pre>
</td>
<td width="203">
<pre>// Comment
</pre>
</td>
<td width="294">
<pre>// Comment

</pre>
</td>
<td width="245">
<pre>// Comment
</pre>
</td>
<td width="196">
<pre>// Comment
</pre>
</td>

<td width="189">
<pre># Comment
</pre>
</td>
<td width="98">
<pre>% Comment
</pre>
</td>
<td width="245">
<pre>; Comment</pre></td>

</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#009933" width="10"><b>multi line comment</b></td>
<td width="212">
<pre></pre>
</td>
<td width="161">
<pre></pre>

</td>
<td width="203">
<pre>/* multi line
comment */
</pre>
</td>
<td width="294">
<pre>/* multi line
comment */
</pre>
</td>
<td width="245">

<pre>/* multi line
comment */
</pre>
</td>
<td width="196">
<pre>/* multi line
comment */
</pre>
</td>
<td width="189">
<pre></pre>
</td>

<td width="98">
<pre>
%{ multi line
comment
%}
</pre>
</td>
<td width="245">
<pre>
</pre>
</td>
</tr>
<tr bgcolor="#FFFFFF">

<td bgcolor="#009933" height="92" width="10"><b>if condition</b></td>
<td height="92" width="212">
<pre>
IF I=1 THEN
...
ELSE
...
END
</pre>
</td>
<td height="92" width="161">
<pre>
If I=1 Then
...
Else
...
End
</pre>

</td>
<td height="92" width="203">
<pre>
if (i==1) {
...
} else {
...
}
</pre>
</td>
<td height="92" width="294">
<pre>
if (i==1) {
...
} else {
...
}
</pre>
</td>

<td height="92" width="245">
<pre>
if (i==1) {
...
} else {
...
}

</pre>
</td>
<td height="92" width="196">
<pre>
if ($i == 1) {
...
} else {
...
}
</pre>
</td>
<td height="92" width="189">

<pre>
if [ $i -eq 1 ]; then
...
else
...
fi
</pre>
</td>
<td height="92" width="98">
<pre>
if i==1
...
else
...
end
</pre>
</td>
<td height="92" width="245">
<pre>

cmp eax,1
jne not_eq
equal: ...
jmp continue
not_eq: ...
continue: ...
</pre>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#009933" class="over" width="10"><b>for loop</b></td>
<td width="212">
<pre>
FOR I = 0 TO 100 STEP 2
...
NEXT I

</pre>
</td>
<td width="161">
<pre>
For I = 0 To 100 Step 2
...
Next I
</pre>
</td>
<td width="203">
<pre>
for (i=0; i<=100; i+=2)
{
...
}

</pre>
</td>
<td width="294">
<pre>
for (i=0; i<=100; i+=2)
{
...
}
</pre>
</td>
<td width="245">
<pre>
for (i=0; i<=100; i+=2)
{
...
}

</pre>
</td>
<td width="196">
<pre>
for ($i=0; $i<=100; $i += 2)
{
...
}
</pre>
</td>
<td width="189">
<pre>
for i in `seq 0 2 100`;
do
echo $i
done

</pre>
</td>
<td width="98">
<pre>
for i=0:2:100
...
end
</pre>
</td>
<td width="245">
<pre>
mov ax, 0
lbl1: ...
add ax, 2
cmp ax, 100
jl lbl1

</pre>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#009933" width="10"><b>while loop</b></td>
<td width="212">
<pre>
DIM i AS INTEGER;
i = 1
WHILE ( i <= 100 )
...
i = i + 1
WEND
</pre>
</td>

<td width="161">
<pre>
DIM i AS INTEGER = 1

While ( i <= 100 )
...
i = i + 1
End
</pre>
</td>
<td width="203">
<pre>
int i = 1;
while ( i <= 100 ) {
...
i++;
}
</pre>
</td>

<td width="294">
<pre>
int i = 1;
while ( i <= 100 ) {
...
i++;
}
</pre>
</td>
<td width="245">
<pre>var i = 1;
while ( i <= 100 ) {
...
i++;
}
</pre>
</td>

<td width="196">
<pre>
$i = 1;
while ( $i <= 100 ) {
...
$i = $i + 1;
}
</pre>
</td>
<td width="189">
<pre>
i=1
while test $i -le 100
do
...
i=`expr $i + 1`

done
</pre>
</td>

<td width="98">
<pre>
i=1
while(i<=100)
...
i=i+1
end
</pre>
</td>
<td width="245">
<pre>
mov ax, 1
lbl1: ...
add ax, 1
cmp ax, 100
jl lbl1
</pre>
</td>

</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#009933" width="10"><b>short<br>
hallo world<br>
program</b></td>
<td width="212">
<pre>PRINT "Hallo World!"

</pre>
</td>
<td width="161">
<pre>
Private Sub Form_Load()
MsgBox "Hallo World!"
End Sub
</pre>
</td>
<td width="203">
<pre>
<font color="#006600">//C style</font>

#include <stdio.h>
int main()
{
puts ("Hallo World!");
return 0;
}


<font color="#006600">//C++ style</font>
#include <iostream>
using namespace std;
int main()
{
cout<<"Hallo World!"<<endl;
return 0;
}
</pre>
</td>
<td width="294">

<pre>
public class Main {
public Main() {
}
public static void main(String [] args) {
System.out.println("Hello World!");
}
}
</pre>
</td>
<td width="245">
<pre>
<html>
<head>
<script type="text/javascript"><!--
alert("Hello World!");
//--></script>

</head>
<body>
</body>
</html>
</pre>
</td>
<td width="196">
<pre>
<html>

<head>
</head>
<body>
<?php
print("Hello World!");
?>
</body>
</html>
</pre>
</td>
<td width="189">

<pre>
#!/bin/bash
echo "Hallo World!"
</pre>
</td>
<td width="98">
<pre>disp "Hallo World!"</pre>
</td>
<td width="245">

<pre>
section .data
hello: db 'Hello world!',10
helloLen: equ $-hello

section .text
global _start

_start:
mov eax,4
mov ebx,1
mov ecx,hello
mov edx,helloLen
int 80h

mov eax,1
mov ebx,0
int 80h
</pre>
</td>
</tr>

<!-- next row Template

<tr bgcolor="#FFFFFF">
<td bgcolor="#009933" width="10"><b></b></td>
<td width="212">
<pre>
</pre>
</td>
<td width="161">
<pre>
</pre>
</td>
<td width="203">
<pre>
</pre>
</td>
<td width="294">
<pre>
</pre>
</td>
<td width="245">
<pre>
</pre>
</td>
<td width="196">
<pre>
</pre>
</td>
<td width="189">
<pre>
</pre>
</td>
<td width="98">
<pre>
</pre>
</td>
<td width="245">
<pre>
</pre>
</td>
</tr>

-->

</table>""



----
Siehe auch {{backlinks}}
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki