Code:
\documentclass[12pt]{scrbook}
\usepackage[latin1]{inputenc}
\usepackage{ngerman}
\usepackage[a4paper]{geometry}
\usepackage{courier}
\usepackage{listings}
\lstset{morekeywords={Global,Local,While,WEnd,If,Then,Select,True,False,ContinueCase,ContinueLoop,Default,Dim,Const,Do,Until,Enum,Exit,ExitLoop,For,Next,In,Func,Return,EndFunc,ElseIf,Else,include,include-once,NoTrayIcon,ReDim,RequireAdmin,Case,EndSelect,EndSwitch,Switch,EndWith,With,Else,EndIf,or,and},
sensitive=false,
morecomment=[l]{;},
morecomment=[s]{#cs}{#ce},
morecomment=[s]{#comments-start}{#comments-end},
morestring=[b]",
morestring=[d]'}
\lstdefinestyle{std}{frame=single,numbers=left,firstnumber=1,numbersep=7pt,basicstyle=\ttfamily, breaklines=true, showstringspaces=false, stringstyle=\ttfamily, keywordstyle=\bfseries\ttfamily, commentstyle=\itshape}
\begin{document}
\begin{lstlisting}[caption={Erfolgskontrolle mit If-Anweisungen}, label=if_check, style=std]
If FileExists("D:\") Then
MsgBox(0, "", "D:\ existiert.")
Else
MsgBox(0, "", "D:\ existiert nicht.")
EndIf
\end{lstlisting}
\end{document}
Meine bisherigen Versuche mit escapechars (") oder Escapen zu LaTeX sind fehlgeschlagen. Auch die Forensuche lieferte mir leider keine Anhaltspunkte.
Lesezeichen