Re: A reeeeaaally small problem

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

Paul Kerslake wrote:

> Well here we go again. I'll be brief:
>
> problem: Expected to see 'end' not a type.
> or procedure or anything else.
>
> Here's an example of my program:
>
> include get.e
>
> object bob
> bob=wait_key()
> if bob='1' then
>     open("g1.ex",r)
> end if
>
>
> Or if I sequence bob it says: Type check failure bob is then it gives me the
> number of the key I pressed.
>
> please to be helping and thanks.

First, wait_key returns an integer key code, not a sequence.
Second, open is a function. You must use it's return value somehow (i.e. by
assigning it to a variable).
Finally, the second argument to open is a string - here it's assuming that
there's a variable/constant
called r.
Here's a fixed example:
include get.e
integer bob, fn
bob = wait_key()
if bob='1' then
    fn = open("g1.ex","r")
end if

Jeffrey Fielding
JJProg at cyberbury.net

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

Search



Quick Links

User menu

Not signed in.

Misc Menu