home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
useful
/
text
/
tex
/
pastex
/
rexx
/
golded
/
tex-formblatt.ged
< prev
next >
Wrap
Text File
|
1994-03-21
|
3KB
|
101 lines
/*
$VER: TeX-Formblatt V0.96 (20.3.94) Axel Burghardt
*/
Title = "TeX-Formblatt V0.96"
OPTIONS RESULTS
/* ----------------- Wie wurde GoldEd gestartet? ------------------ */
IF (LEFT(ADDRESS(), 6) ~= "GOLDED") THEN address 'GOLDED.1'
'LOCK CURRENT'
OPTIONS FAILAT 6
SIGNAL ON SYNTAX
/* -------------------------- Hauptteil --------------------------- */
'REQUEST BODY="Welches Formblatt soll gewählt werden?" BUTTON="Brief|_Abbrechen" TITLE="'Title'"'
SELECT
WHEN Result=1 THEN DO
call Brief Title
END
OTHERWISE
'REQUEST BODY="Abbruch durch Anwender!" TITLE="'Title'"'
END
'UNLOCK'
EXIT 0
/* ----------------------- Fehlerbehandlung ----------------------- */
SYNTAX:
'REQUEST BODY="Fehler in Zeile' SIGL ':' ERRORTEXT(RC) '"'
'MARK HIDE'
'GOTO LINE='SIGL
'MARK SET'
'UNLOCK'
EXIT 5
/* ------------------------ Brief-Formular ------------------------ */
Brief:
PROCEDURE
PARSE ARG Title
Formblatt = "TEXT:Formblatt/"
'REQUEST BODY="Brief speichern unter:" STRING TITLE="'Title'"'
Dateiname = Result
'OPEN QUIET NEW NAME="'Dateiname'"'
'OPEN APPEND NAME="'Formblatt'Brief.TeX"'
'TEXT T="% Generiert am 'date()','time() 'durch' Title'"'
'REPLACE CONFIRM=FALSE STRING="Dateiname" BY="'specials(Dateiname)'" NEXT'
call Abfrage("Frau/Herr etc.",'\\',Title)
call Abfrage("Empfänger",'\\',Title)
call Abfrage("Special",'\\',Title)
call Abfrage("Straße",'\\',Title)
call Abfrage("Wohnort",'',Title)
call Abfrage("Anrede",'',Title)
call Abfrage("Schluß",'',Title)
RETURN
/* ----------------- Ersetze die Schlüsselwörter ------------------ */
Abfrage: PROCEDURE
PARSE ARG Key,End,Title
'REQUEST BODY="'Key'" STRING TITLE="'Title'"'
IF RC=0 THEN DO
Rep = Specials(Result)
IF Rep~='' THEN Rep = Rep||End
'REPLACE CONFIRM=FALSE STRING="'Key'" BY="'Rep'" NEXT'
END
RETURN
/* ---------------- Ersetzte Sonderzeichen $&%#_{} ---------------- */
Specials: PROCEDURE
PARSE ARG Text
Text = Special(Text,'$')
Text = Special(Text,'&')
Text = Special(Text,'%')
Text = Special(Text,'#')
Text = Special(Text,'_')
Text = Special(Text,'{')
Text = Special(Text,'}')
RETURN Text
/* --------------------- Ersetzte x durch \x ---------------------- */
Special: PROCEDURE
PARSE ARG Text,Character
P = -1
DO UNTIL P = 0
P = index(Text,Character,P+2)
IF P > 0 THEN Text = Left(Text,P-1) || '\'Character || Right(Text,Length(Text)-P)
END
RETURN Text