PofoWiki

Die ultimative Informationsquelle zum ATARI Portfolio

Benutzer-Werkzeuge

Webseiten-Werkzeuge


software:diy:pascal:pascalbjg

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
software:diy:pascal:pascalbjg [16/09/2006 01:09] – Text umgestellt. uxtsoftware: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, sie verwenden die AES-Routinen (Application-Environment-Services) des BIOS Int 60h.
  
 +
 +B.J. Gleason (Author von PBasic) schrieb dieses Programm in 1992, ein Artikel darüber ist in der Mai/Juni-Ausgabe von ATARI Explorer erschienen.
 +
 +
 +<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.  The program will
 +        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))>l then l:=length(paramstr(x));
 +       end;
 +     menus := menus + chr(0);
 +
 +     for x:=1 to length(menus) do
 +       if menus[x]='_' then menus[x] := ' ';
 +
 +     { now call the internal ROM BIOS Menu functions }
 +
 +     regs.ah := $0f;
 +     regs.al := 65;
 +     regs.bh := 0;
 +     regs.cx := 0;
 +     if l<36 then x:=(40-(l+4)) div 2 else x:=0;
 +     if paramcount<6 then y:=(8-(paramcount+1)) div 2 else y:=0;
 +     regs.dh := y;
 +     regs.dl := x;
 +     regs.ds := seg(menus);
 +     regs.si := ofs(menus)+1;
 +     regs.di := $0ffff;
 +     intr($60, regs);
 +     inc(regs.ax);
 +     halt(regs.ax and $0ff);
 +end.
 +
 +</code>