1. key_press

------=_NextPart_000_0007_01BDECB3.5CFE1B20
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hiya
could some plz tell me how to open another document in my program =
ie:"hello.ex"
by using the command "system"
i have been trying this but it dont work=20
atom keypress=20

keypress =3D wait_key()

if keypress =3D '1' or keypress  =3D '3' then

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

or have i cocked this right up

plz help someone

thanx brent


------=_NextPart_000_0007_01BDECB3.5CFE1B20
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>hiya</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>could some plz tell me how to open =
another=20
document in my program ie:&quot;hello.ex&quot;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>by using the command=20
&quot;system&quot;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>i have been trying this but it dont =
work <FONT=20
size=3D2>
<P>atom keypress </P>
<P>keypress =3D wait_key()</P>
<P>if keypress =3D '1' or keypress&nbsp; =3D '3' then</P><FONT size=3D2>
<P>system(&quot;C:\\EUPHORIA\\hello.ex&quot;,0) system(&quot;&quot;,0)=20
system(&quot;&quot;,0)</FONT></P><FONT size=3D2>
<P>or have i cocked this right up</P>
<P>plz help someone</P>

------=_NextPart_000_0007_01BDECB3.5CFE1B20--

new topic     » topic index » view message » categorize

2. key_press

try this:

include get.e
keypress =3D wait_key()
if keypress =3D '1' or keypress  =3D '3' then

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

end if

This is untested.

Alan
 =

new topic     » goto parent     » topic index » view message » categorize

3. key_press

Brent wrote:

>hiya
>could some plz tell me how to open another document in my program
ie:"hello.ex"
>by using the command "system"
>i have been trying this but it dont work =

>atom keypress =


>keypress =3D wait_key()

>if keypress =3D '1' or keypress  =3D '3' then

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

>or have i cocked this right up

>plz help someone

>thanx brent

If you want to execute the program hello.ex from within another program, =
do
this by:

system("C:\\euphoria\\ex hello.ex", 0)

The ex part is for starting up the interpreter again; in fact, a second
copy of the interpreter, if I'm not mistaken. I don't get what you want t=
o
achieve by system("", 0).
At it's best, this will do nothing, just like when you press Enter on an
empty command line.

Hope this helps,

Ad

new topic     » goto parent     » topic index » view message » categorize

4. Re: key_press

On Wed, 30 Sep 1998 20:46:13 +1200, bn <mrsmoo at ES.CO.NZ> wrote:

>hiya
>could some plz tell me how to open another document in my program ie:"hello.ex"
>by using the command "system"
>i have been trying this but it dont work
>atom keypress
>
>keypress = wait_key()
>
>if keypress = '1' or keypress  = '3' then
>
>system("C:\\EUPHORIA\\hello.ex",0) system("",0) system("",0)
>
>or have i cocked this right up

include get.e

atom keypress

keypress = wait_key()
if keypress = '1' then
 system("C:\\EUPHORIA\\TEST.EXE",0)
end if

That will work. So will
 system("DIR",0) -- do a dos DIR

but system("C:\\EUPHORIA\\TEST.EX",0)
won't do anything, since TEST.EX won't
run. Either "bind" it into an .EXE, or
try:

 system("C:\\EUPHORIA\\BIN\\EX.EXE TEST.EX",0)
to run another copy of Euphoria with the
program file TEST.EX.

Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: key_press

include get.e
object keypress

keypress =wait_key()

if compare('1',keypress)=0 or compare('3',keypress) then
system("ex C:\\EUPHORIA\\hello.ex",2)

that should do the trick
___________________________
When it comes to programming languages, Euphoria is a cut above -
matt1278 at juno.com and matt1421 at juno.com(and soon to be
irisnmatt at prodigy.net. Then again, maybe not) Euphoria programmer
Web users: <A HREF=mailto:"matt1421 at juno.com">matt1421 at juno.com</A> or <A

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

new topic     » goto parent     » topic index » view message » categorize

6. key_press

------=_NextPart_000_0004_01BDED69.A72041E0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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)=20




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

procedure main_menu()

-- main menu --

clear_screen()

text_color(4)

bk_color(8)

puts(1 =
=CD=CD=CD=CD=CD=BB" )

puts(1 ,"=BA The Magnificent Menu =BA" )

puts(1 =
=CD=CD=CD=CD=CD=B9" )

puts(1 ,"=BA Press............ =BA Press............ =CC THIS =B9" )=20

puts(1 ,"=BA =BA =CC IS =B9" )

puts(1 ,"=BA =BA =CC MaGnIfIcEnT =B9" )

puts(1 ,"=BA =BA Q.to quit =
=CC=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=B9" )

puts(1 ,"=BA =BA =CC =B9" )

puts(1 ,"=BA =BA =CC =B9" )

puts(1 ,"=BA =
=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=B9" )

puts(1 ,"=BA =BA MY FIRST PROGRAM" )

puts(1 ,"=BA =BA =BA" )

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

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

puts(1 ,"=BA =BA =BA" )

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

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

puts(1 =
=CD=CD=CD=CD=CD=BC" )


end procedure

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

procedure descriptions()

-- Key descriptions --=20

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 --

-------------------------------------------------------------------------=
------


-------------------------------------------------------------------------=
------=20

atom keypress=20

keypress =3D wait_key()

if keypress =3D '1' then

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

elsif keypress =3D '2' then

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

elsif keypress =3D '3' then

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

elsif keypress =3D '4' then

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

elsif keypress =3D '5' then

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

elsif keypress =3D '6' then

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

elsif keypress =3D '7' then

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

elsif keypress =3D '8' then

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

elsif keypress =3D '9' then

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

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

--clear_screen()

--cursor(UNDERLINE_CURSOR)

if graphics_mode(-1) then

end if

abort(1)

end if=20


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_0004_01BDED69.A72041E0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<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; THIS=20
&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, =
&ordm;&quot;=20
)</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 =
&ordm;&quot;=20
)</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_0004_01BDED69.A72041E0--

new topic     » goto parent     » topic index » view message » categorize

7. Re: key_press

------=_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 message » categorize

8. Re: key_press

ok, just one thing. Your mailer program botched up what you wrote.
___________________________
When it comes to programming languages, Euphoria is a cut above -
matt1278 at juno.com and matt1421 at juno.com(and soon to be
irisnmatt at prodigy.net. Then again, maybe not) Euphoria programmer
Web users: <A HREF=mailto:"matt1421 at juno.com">matt1421 at juno.com</A> or <A

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

new topic     » goto parent     » topic index » view message » categorize

9. Re: key_press

-- Try this, it works.
-- BTW, on my Euphoria disk, the Langwar program
-- is named LW.EX,
-- so calling system(langwar) won't do anything.

with warning
with type_check

-- Includes --
include get.e
include graphics.e
include wildcard.e

constant PROMPT =3D 1, CMD =3D 2,
 Programs =3D
 {{"Euphoria Constant", "ex constant.ex"},
  {"DOS Directory",     "DIR"},
  {"Euphoria LangWar",  "ex c:\\euphoria\\demo\\langwar\\lw.ex"}}

procedure main_menu()
-- main menu --
clear_screen()
text_color(4)
bk_color(8)

puts(1 ,"=C9=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=
=CD=CD=CD=CD=BB" )
puts(1 ,"=BA The Magnificent Menu                                           =
              =BA" )
puts(1 ,"=CC=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=
=CD=CD=CD=CD=B9" )
puts(1 ,"=BA Press............                    =BA Press............ =CC =
THIS              =B9" )
puts(1 ,"=BA                                      =BA                   =CC =
is                =B9" )
puts(1 ,"=BA                                      =BA                   =CC =
MaGnIfIcEnT       =B9" )
puts(1 ,"=BA                                      =BA Q.to quit         =CC=CD=
=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=B9" )
puts(1 ,"=BA                                      =BA                   =CC =
                  =B9" )
puts(1 ,"=BA                                      =BA                   =CC =
                  =B9" )
puts(1 ,"=BA                                      =CC=CD=CD=CD=CD=CD=CD=CD=CD=
=CD=CD=CD=CD=CD=B9" )
puts(1 ,"=BA                                      =BA MY FIRST PROGRAM      =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA A programmable menu sy=
stem for DOS,   =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA                       =
                =BA" )
puts(1 ,"=BA                                      =BA Report any bugs and mi=
sspelled words  =BA" )
puts(1 ,"=BA                                      =BA to my E-mail address..=
MRSMOO at ES.CO.NZ =BA" )
puts(1 ,"=C8=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=CD=
=CD=CD=CD=CD=BC" )

end procedure

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

procedure descriptions()
-- Key descriptions --
for i =3D 1 to length(Programs) do
    position(i+5,4)
    printf(1,"%d =3D %s",{i, Programs[i][PROMPT]})
end for
end procedure

procedure main_control()
-- Main control --
-- Only 1 - 9 --

atom keypress, index
keypress =3D -1
while keypress !=3D 'Q' do
 keypress =3D upper(wait_key())
 index =3D keypress - 48 -- convert from ascii to value
 if index > 0 and index <=3D length(Programs) then
    position(21,3)
    printf(1,"Your choice was: %d",index)
    position(22,3)
    system(Programs[index][CMD],0)
    main_menu()
    descriptions()
 end if
end while
end procedure

--------------------------< MAIN >-------------------------
main_menu()
descriptions()
main_control()
------------------------------------------------------------

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu