\ProvidesFile{fdtxttex.tex}[2011/09/13 txt to TeX by dialogue (UL)]
\RequirePackage{fddial0g}
%   \errorcontextlines=4
\MakeSet{job-name}{\JobName}
\MakeSet{in-ext}  {\InputExtension}
\MakeSet{out-ext} {\OutputExtension}
\MakeSet{corr-f}  {\CorrectionFile}
\MakeSet{f-head}  {\FileHeader}
\MakeSet{f-foot}  {\FileFooter}
\newif\ifShowLines
\MakeSet{show-l}  {\ShowLines}
\TryDialogueCFG{fdtxttex}{%
    \JobName{sample}
    \InputExtension{txt}
    \OutputExtension{tex}
    \CorrectionFile{mdoccorr.cfg}
    \FileHeader{\protect\WriteProvides}
    \FileFooter{}
    \ShowLines{false}
}
% \DebugShowVar{cfg-f}
\Announce{ *fdtxttex.tex* txt to TeX by dialogue^^J
          (apply \string\MakeDocCorrectHook)^^J}
\newcommand*{\VarShowSettings}{%
    \ShowSet{job-name}\LBrk\Spaces{15}
    \ShowSet{in-ext} \space
    \ShowSet{out-ext}\LBrk
    \ShowSet{corr-f}
    (define \BackslashChar MakeDocCorrectHook)\LBrk
    \ShowSet{f-head}\LBrk
    \ShowSet{f-foot}\LBrk
    \Spaces{15}
    \ShowSet{show-l}
}%
\newcommand*{\VarRunSettings}{%
    \input{\UseSet{corr-f}}%
    \typeout{`fdtxttex.tex' generating 
             `\UseSet{job-name}.\UseSet{out-ext}'.}%
    \UseResultFile{\UseSet{job-name}.\UseSet{out-ext}}%
    \IfEmptySet{f-head}{}{\UseSet{f-head}}%
    \EvalBooleanSet{show-l}%
    \ProcessFileWith{\UseSet{job-name}.\UseSet{in-ext}}{%
        \WriteResult{\CorrectedInputLine}%
        \ifShowLines
            \typeout{\CorrectedInputLine}%
        \else
            \message{.}%
        \fi}%
    \IfEmptySet{f-foot}{}{\UseSet{f-foot}}%
} 

\DialogueLoop

\stop