Content added Content deleted
imported>mutante m (New page: On Windows, put: <pre> Module HalloWelt Sub Main() Console.WriteLine("Hallo, Welt!") End Sub End Module </pre> in a textfile with any texteditor, save it as fnord.vb then ...) |
imported>mutante mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
<tt> |
<tt> |
||
C:\%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\vbc.exe fnord.vb |
C:\%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\vbc.exe fnord.vb |
||
</tt> |
|||
⚫ | |||
⚫ | |||
(*) If you cant find vbc.exe on your box you need to install [http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx .Net Framework], you dont need the complete SDK, that is optional. |
(*) If you cant find vbc.exe on your box you need to install [http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx .Net Framework], you dont need the complete SDK, that is optional. |
||
.. and you will have a new '''fnord.exe''' and compiled your own windows commandline executable. |
.. and you will have a new '''fnord.exe''' and compiled your own windows commandline executable. |
||
<tt> |
|||
⚫ | |||
C:\fnord.exe</tt> |
|||
Hallo, Welt!<tt> |
|||
</tt> |
|||
⚫ | |||
=== Beispiel Nettoberechnung === |
|||
<pre> |
|||
' Berechnet Nettobetrag aus Bruttobetrag und Steuersatz |
|||
Imports System.Console |
|||
Module T1 |
|||
Sub Main() |
|||
Dim br as Double |
|||
Dim st as Double |
|||
Dim netto as Double |
|||
Dim nochmal as String |
|||
WriteLine("'Programm T1' - Berechnet Nettobetrag aus Bruttobetrag und Steuersatz") |
|||
DO |
|||
br=0 |
|||
DO WHILE br <= 0 |
|||
WriteLine("Bitte einen Bruttobetrag eingeben. (Der Bruttobetrag muss > 0 sein.): ") |
|||
br=ReadLine(): |
|||
LOOP |
|||
st=0 |
|||
DO WHILE st <= 0 OR st > 100 |
|||
WriteLine("Bitte einen Steuersatz in Prozent eingeben (Steuer muss > 0 und <= 100 sein!) %: ") |
|||
st=ReadLine(): |
|||
LOOP |
|||
netto=br-(br/100*st) |
|||
Write("Der Nettobetrag ist: ") |
|||
WriteLine(Netto) |
|||
Write("Nochmal rechnen? (j/n): ") |
|||
nochmal=ReadLine(): |
|||
LOOP UNTIL nochmal="n" |
|||
End Sub |
|||
End Module |
|||
</pre> |
|||
[[Category:Programming]] |
|||
[[Category:Windows]] |
Latest revision as of 16:52, 23 February 2007
On Windows, put:
Module HalloWelt Sub Main() Console.WriteLine("Hallo, Welt!") End Sub End Module
in a textfile with any texteditor, save it as fnord.vb
then on a cmd.exe ,type:
C:\%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\vbc.exe fnord.vb
(or wherever you have vbc.exe, which is the visual basic compiler) (*)
(*) If you cant find vbc.exe on your box you need to install .Net Framework, you dont need the complete SDK, that is optional.
.. and you will have a new fnord.exe and compiled your own windows commandline executable.
C:\fnord.exe Hallo, Welt!
ergo: also on Windows you dont need a GUI to create applications.
Beispiel Nettoberechnung[edit]
' Berechnet Nettobetrag aus Bruttobetrag und Steuersatz Imports System.Console Module T1 Sub Main() Dim br as Double Dim st as Double Dim netto as Double Dim nochmal as String WriteLine("'Programm T1' - Berechnet Nettobetrag aus Bruttobetrag und Steuersatz") DO br=0 DO WHILE br <= 0 WriteLine("Bitte einen Bruttobetrag eingeben. (Der Bruttobetrag muss > 0 sein.): ") br=ReadLine(): LOOP st=0 DO WHILE st <= 0 OR st > 100 WriteLine("Bitte einen Steuersatz in Prozent eingeben (Steuer muss > 0 und <= 100 sein!) %: ") st=ReadLine(): LOOP netto=br-(br/100*st) Write("Der Nettobetrag ist: ") WriteLine(Netto) Write("Nochmal rechnen? (j/n): ") nochmal=ReadLine(): LOOP UNTIL nochmal="n" End Sub End Module