fb:porticula NoPaste
Text-User-Interface-Menü-Beispiel
Uploader: | The_Muh |
Datum/Zeit: | 05.08.2008 18:49:23 |
screenres 400,400
type options
bezeichnung as string
wert as integer
wert2 as string
end type
dim menu() as options
redim preserve menu(1 to 3)
menu(1).bezeichnung = "'Hallo' Anzeigen?"
menu(1).wert = 0
menu(1).wert2 = "hallo "
menu(2).bezeichnung = "'Ihr' Anzeigen?"
menu(2).wert = 1
menu(2).wert2 = "ihr "
menu(3).bezeichnung = "'da' Anzeigen?"
menu(3).wert = 0
menu(3).wert2 = "da "
dim shared as integer hoehe = 50, breite = 55
dim sh as integer
dim a as integer
dim as integer c = 1
dim key as string
do
cls
print "Bedinung mit den Pfeiltasten, Beenden mit ESC"
for sh as integer = 1 to ubound(menu) 'text anzeigen...
if SH <= ubound(menu) then
locate sh+2 ,1
if sh = c then
print "X "& menu(sh).bezeichnung &" Wert: "& menu(sh).wert
else
print " "& menu(sh).bezeichnung & " Wert: "& menu(sh).wert
end if
else
exit for
end if
if sh = 50 then exit for
next sh
for i as integer = lbound(menu) to ubound(menu)
if menu(i).wert = 1 then print Menu(i).wert2 ;
next
do : sleep 1 : key = inkey : loop until key <> ""
select case key
case chr(255,77) ' rechts
if menu(c + a).wert = 1 then
menu(c + a).wert = 0
else
menu(c + a).wert = 1
end if
case chr(255,75) 'links
if menu(c + a).wert = 1 then
menu(c + a).wert = 0
else
menu(c + a).wert = 1
end if
case chr(255,72) 'oben
if c = 1 then
c = ubound(menu)
else
c -= 1
end if
case chr(255,80) 'unten
if c < ubound(menu) then
c += 1
else
c = 1
end if
case chr(27)
exit do
end select
loop