Re: key_press

new topic     » goto parent     » topic index » view thread      » older message » newer message

------=_NextPart_000_0003_01BDED1C.9A432200
        charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

If you put system( .... ,1) instead of system( .... ,0) in the system()
call, DOS waits for a keypress to continue, so may be handy for debugging.
Jesús.


    -----Mensaje original-----
    De: Euphoria Programming for MS-DOS
[mailto:EUPHORIA at LISTSERV.MUOHIO.EDU]En nombre de bn
    Enviado el: jueves 1 de octubre de 1998 7:31
    Para: EUPHORIA at LISTSERV.MUOHIO.EDU
    Asunto: key_press


    hiya
    still having trouble with the key press
    here is the complete program
    with warning

    with type_check

    -- Includes --

    include get.e

    include graphics.e

    include mouse.e

    mouse_events(LEFT_DOWN + LEFT_UP + RIGHT_DOWN)




    --------------

    procedure main_menu()

    -- main menu --

    clear_screen()

    text_color(4)

    bk_color(8)

    puts(1
,"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍÍ»" )

    puts(1 ,"º The Magnificent Menu º" )

    puts(1
,"ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍ͹" )

    puts(1 ,"º Press............ º Press............ Ì THIS ¹" )

    puts(1 ,"º º Ì IS ¹" )

    puts(1 ,"º º Ì MaGnIfIcEnT ¹" )

    puts(1 ,"º º Q.to quit ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹" )

    puts(1 ,"º º Ì ¹" )

    puts(1 ,"º º Ì ¹" )

    puts(1 ,"º ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹" )

    puts(1 ,"º º MY FIRST PROGRAM" )

    puts(1 ,"º º º" )

    puts(1 ,"º º A programmable menu system for DOS, º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º º" )

    puts(1 ,"º º Report any bugs and misspelled words º" )

    puts(1 ,"º º to my E-mail address..MRSMOO at ES.CO.NZº" )

    puts(1
,"ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
ÍÍÍÍͼ" )


    end procedure

    -------------

    procedure descriptions()

    -- Key descriptions --

    position(6,4)

    puts(1, "1. CONSTANT")

    position(8,4)

    puts(1, "2. GAMES ONE PLAYER")

    position(10,4)

    puts(1, "3. UTILITIES")

    position(12,4)

    puts(1, "4.PARK HEADS")

    position(14,4)

    puts(1, "5.Description for key 5")

    position(16,4)

    puts(1, "6.Description for key 6")

    position(18,4)

    puts(1, "7.Description for key 7")

    position(20,4)

    puts(1, "8.Description for key 8")

    position(22,4)

    puts(1, "9.Description for key 9")

    cursor(UNDERLINE_CURSOR)

    end procedure

    -------------


    procedure main_control()

    -- Main control --

    -- Only 1 - 9 --

    ------------------------------------------------------------------------
-------


    ------------------------------------------------------------------------
-------

    atom keypress

    keypress = wait_key()

    if keypress = '1' then

    system("ex C:\\EUPHORIA\\constant.ex",0)

    elsif keypress = '2' then

    system("",0) system("",0) system("",0)

    elsif keypress = '3' then

    system("",0) system("",0) system("",0)

    elsif keypress = '4' then

    system("",0) system("",0) system("",0)

    elsif keypress = '5' then

    system("",0) system("",0) system("",0)

    elsif keypress = '6' then

    system("",0) system("",0) system("",0)

    elsif keypress = '7' then

    system("",0) system("",0) system("",0)

    elsif keypress = '8' then

    system("",0) system("",0) system("",0)

    elsif keypress = '9' then

    system("",0) system("",0) system("",0)

    elsif keypress = 'q' or keypress = 'Q' then

    --clear_screen()

    --cursor(UNDERLINE_CURSOR)

    if graphics_mode(-1) then

    end if

    abort(1)

    end if


    main_menu()

    descriptions()

    main_control()

    end procedure

    -------------

    main_menu()

    descriptions()

    main_control()

    IF YOU GO UP TO ATOM KEY_PRESS you will see the dos command i have been
using.when i hit 1 the constant .ex program flashes on screen then just goes
away

    any ideas?????????????/

    thanx brent






------=_NextPart_000_0003_01BDED1C.9A432200
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">



<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D980201807-01101998><FONT color=3D#0000ff face=3DArial =
size=3D2>If you=20
put system( .... ,1) instead of system( .... ,0) in the system() call, =
DOS waits=20
for a keypress to continue, so may be handy for =
debugging.</FONT></SPAN></DIV>
<P><FONT size=3D2><SPAN class=3D980201807-01101998><FONT color=3D#000000 =
face=3DArial=20
size=3D2>J</FONT></SPAN>es&uacute;s<SPAN =
class=3D980201807-01101998><FONT=20
color=3D#000000 face=3DArial size=3D2>.</FONT></SPAN> </FONT></P>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #0000ff solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV class=3DOutlookMessageHeader><FONT face=3D"Times New Roman"=20
    size=3D2>-----Mensaje original-----<BR><B>De:</B> Euphoria =
Programming for=20
    MS-DOS [mailto:EUPHORIA at LISTSERV.MUOHIO.EDU]<B>En nombre de</B>=20
    bn<BR><B>Enviado el:</B> jueves 1 de octubre de 1998 =
7:31<BR><B>Para:</B>=20
    EUPHORIA at LISTSERV.MUOHIO.EDU<BR><B>Asunto:</B>=20
key_press<BR><BR></FONT></DIV>
    <DIV><FONT color=3D#000000 size=3D2>hiya</FONT></DIV>
    <DIV><FONT color=3D#000000 size=3D2>still having trouble with the =
key=20
    press</FONT></DIV>
    <DIV><FONT color=3D#000000 size=3D2>here is the complete =
program</FONT></DIV>
    <DIV><FONT color=3D#000000 size=3D2><FONT size=3D2>
    <P>with warning</P>
    <P>with type_check</P>
    <P>-- Includes --</P>
    <P>include get.e</P>
    <P>include graphics.e</P>
    <P>include mouse.e</P>
    <P>mouse_events(LEFT_DOWN + LEFT_UP + RIGHT_DOWN) </P>
    <P></P>
    <P>&nbsp;</P>
    <P>--------------</P>
    <P>procedure main_menu()</P>
    <P>-- main menu --</P>
    <P>clear_screen()</P>
    <P>text_color(4)</P>
    <P>bk_color(8)</P>
    <P>puts(1=20
    =
    )</P>
    <P>puts(1 ,&quot;&ordm; The Magnificent Menu &ordm;&quot; )</P>
    <P>puts(1=20
    =
    )</P>
    <P>puts(1 ,&quot;&ordm; Press............ &ordm; Press............ =
&Igrave;=20
    THIS &sup1;&quot; ) </P>
    <P>puts(1 ,&quot;&ordm; &ordm; &Igrave; IS &sup1;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &Igrave; MaGnIfIcEnT &sup1;&quot; =
)</P>
    <P>puts(1 ,&quot;&ordm; &ordm; Q.to quit=20
    =
acute;&Iacute;&sup1;&quot;=20
    )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &Igrave; &sup1;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &Igrave; &sup1;&quot; )</P>
    <P>puts(1 ,&quot;&ordm;=20
    =
te;&Iacute;&Iacute;&Iacute;&sup1;&quot;=20
    )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; MY FIRST PROGRAM&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; A programmable menu system for DOS,=20
    &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; Report any bugs and misspelled words=20
    &ordm;&quot; )</P>
    <P>puts(1 ,&quot;&ordm; &ordm; to my E-mail <A=20
    =
m;&quot;=20
    )</P>
    <P>puts(1=20
    =
    )</P>
    <P></P>
    <P>end procedure</P>
    <P>-------------</P>
    <P>procedure descriptions()</P>
    <P>-- Key descriptions -- </P>
    <P>position(6,4)</P>
    <P>puts(1, &quot;1. CONSTANT&quot;)</P>
    <P>position(8,4)</P>
    <P>puts(1, &quot;2. GAMES ONE PLAYER&quot;)</P>
    <P>position(10,4)</P>
    <P>puts(1, &quot;3. UTILITIES&quot;)</P>
    <P>position(12,4)</P>
    <P>puts(1, &quot;4.PARK HEADS&quot;)</P>
    <P>position(14,4)</P>
    <P>puts(1, &quot;5.Description for key 5&quot;)</P>
    <P>position(16,4)</P>
    <P>puts(1, &quot;6.Description for key 6&quot;)</P>
    <P>position(18,4)</P>
    <P>puts(1, &quot;7.Description for key 7&quot;)</P>
    <P>position(20,4)</P>
    <P>puts(1, &quot;8.Description for key 8&quot;)</P>
    <P>position(22,4)</P>
    <P>puts(1, &quot;9.Description for key 9&quot;)</P>
    <P>cursor(UNDERLINE_CURSOR)</P>
    <P>end procedure</P>
    <P>-------------</P>
    <P></P>
    <P>procedure main_control()</P>
    <P>-- Main control --</P>
    <P>-- Only 1 - 9 --</P>
    =
<P>----------------------------------------------------------------------=
---------</P>
    <P></P>
    =
<P>----------------------------------------------------------------------=
---------=20
    </P>
    <P>atom keypress </P>
    <P>keypress =3D wait_key()</P>
    <P>if keypress =3D '1' then</P>
    <P>system(&quot;ex C:\\EUPHORIA\\constant.ex&quot;,0) </P>
    <P>elsif keypress =3D '2' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '3' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '4' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '5' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '6' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '7' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '8' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D '9' then</P>
    <P>system(&quot;&quot;,0) system(&quot;&quot;,0) =
system(&quot;&quot;,0)</P>
    <P>elsif keypress =3D 'q' or keypress =3D 'Q' then</P>
    <P>--clear_screen()</P>
    <P>--cursor(UNDERLINE_CURSOR)</P>
    <P>if graphics_mode(-1) then</P>
    <P>end if</P>
    <P>abort(1)</P>
    <P>end if </P>
    <P></P>
    <P>main_menu()</P>
    <P>descriptions()</P>
    <P>main_control()</P>
    <P>end procedure</P>
    <P>-------------</P>
    <P>main_menu()</P>
    <P>descriptions()</P>
    <P>main_control()</P>
    <P>IF YOU GO UP TO ATOM KEY_PRESS you will see the dos command i =
have been=20
    using.when i hit 1 the constant .ex program flashes on screen then =
just goes=20
    away</P>
    <P>any ideas?????????????/</P>
    <P>thanx brent</P>
    <P>&nbsp;</P>

------=_NextPart_000_0003_01BDED1C.9A432200--

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu