Re: Live Tutoria?

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

include ..\..\include\Inkey.e

Inkey.e
=========================
=========================
=============
global function Inkey()
return get_key()
end function

global procedure Prekey()
while Inkey() > -1 do
end while
end procedure
=========================
=========================
=============

------------------------------main program---------------
include Inkey.e
integer Key

Prekey()


while Key != 27 do

Key = Inkey()

? Inkey()

end while

You've kind of got things out of order.
You didn't declare Key in your main program.

If you want to declare Key in your include file that's ok but it must be
global.

--include file
Inkey.e
global integer Key--the first way

or

-----main program
integer Key--the second way


Either way will work.
Actually it is best not to make things global unless it's absolutely necessary
So the second way is best. 

I hope this is clear.

Don Cole
 A Bug is an un-documented feature.
A Feature is a documented Bug.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu