software:diy:pascal:pascalbjg
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| software:diy:pascal:pascalbjg [16/09/2006 01:09] – Text umgestellt. uxt | software:diy:pascal:pascalbjg [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== MENU.EXE ====== | ||
| + | MENU.EXE erlaubt es Menüs in Batch-Dateien zu verwenden die genau wie Portfolio´s eingebaute Applikationen aussehen, besser gesagt, genau so funktionieren, | ||
| + | |||
| + | B.J. Gleason (Author von PBasic) schrieb dieses Programm in 1992, ein Artikel darüber ist in der Mai/ | ||
| + | |||
| + | |||
| + | <code pascal> | ||
| + | program batmenu; | ||
| + | |||
| + | { this program is invoked from the command line: | ||
| + | |||
| + | menu title item1 item2 .... itemN | ||
| + | |||
| + | You can then choose one of the items. | ||
| + | set the DOS variable ERRORLEVEL, so that you can then | ||
| + | perform an action in a BATCH file with the statement: | ||
| + | |||
| + | IF ERRORLEVEL=2 GOTO PROG2: | ||
| + | |||
| + | returns 0 if escape is pressed, otherwise the item number | ||
| + | |||
| + | the menu will be automatically centered on the screen. | ||
| + | |||
| + | |||
| + | Written by BJ Gleason | ||
| + | Copyright 1992, BJ Gleason | ||
| + | |||
| + | } | ||
| + | |||
| + | uses dos; | ||
| + | |||
| + | var | ||
| + | menus : string; | ||
| + | l,x,y : integer; | ||
| + | regs : registers; | ||
| + | |||
| + | begin | ||
| + | { read the parameters from the command line } | ||
| + | { add them to the menu string } | ||
| + | |||
| + | menus := ''; | ||
| + | l := 0; | ||
| + | for x:=1 to paramcount do | ||
| + | begin | ||
| + | menus := menus + paramstr(x) + chr(0); | ||
| + | if length(paramstr(x))> | ||
| + | end; | ||
| + | menus := menus + chr(0); | ||
| + | |||
| + | for x:=1 to length(menus) do | ||
| + | if menus[x]=' | ||
| + | |||
| + | { now call the internal ROM BIOS Menu functions } | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | if l<36 then x: | ||
| + | if paramcount< | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | end. | ||
| + | |||
| + | </ | ||
