User Tools

Site Tools


os:windows:batch

This is an old revision of the document!


Table of Contents

Batch

Pseudo-Funktion

Mit Batch lässt sich eine primitive Form einer Funktion nachstellen. Dies sieht wie folgt aus:

@echo off

call :r
call :p %read%

pause
goto:eof

:p
echo %1
goto:eof

:r
set /p read=Eingabe: 
goto:eof

Der Ablauf:

  • call wird ausgeführt, zu Sprungpunkt :r
  • :r liest wert von Tastatur ein uns speichert ihn in in die Variable “read”.
  • :r wird beendet mit goto:eof
  • call wird ausgeführt, zu Sprungpunkt :p, übergeben wird die Variable read
  • das erste Argument, welche dem Sprungpunkt über die Call-Funktion mitgegeben wird, wird ausgegeben
  • :p wird beendet mit goto:eof
  • pause wird ausgeführt
  • batch-file wird beendet

Skelett:

@echo off

call :function1
call :function2 argument1 argument2
goto:eof


:function1

goto:eof


:function2

goto:eof
os/windows/batch.1297249932.txt.gz · Last modified: 2014-12-18 20:10 (external edit)