1. Calling a procedure
Hi everybody. Another newbie question. Here is a bit of code....
include get.e
object x,i
x = "Jos"
procedure ABC()
position (10,10)
puts(1,x)
puts (1,"\n")
i = wait_key()
end procedure
ABC
This does not work. I just see the console window briefly with nothing
on it. Yet If I remove procedure...end procedure, it works perfectly.
This must be very simple. Sorry to waist your time
TIA
Serge Lavigne
2. Re: Calling a procedure
----- Original Message -----
From: "jondolar" <lavigne.s at videotron.ca>
To: "EUforum" <EUforum at topica.com>
Subject: Calling a procedure
>
>
> Hi everybody. Another newbie question. Here is a bit of code....
>
> include get.e
> object x,i
> x = "Jos"
> procedure ABC()
> position (10,10)
> puts(1,x)
> puts (1,"\n")
> i = wait_key()
> end procedure
>
> ABC
>
> This does not work. I just see the console window briefly with nothing
> on it. Yet If I remove procedure...end procedure, it works perfectly.
> This must be very simple. Sorry to waist your time
>
To call the procedure named "ABC" you need to say "ABC()". In your example
you just have "ABC" after the "end procedure" line, without the parenthesis.
include get.e
object x,i
x = "Jos"
procedure ABC()
position (10,10)
puts(1,x)
puts (1,"\n")
i = wait_key()
end procedure
ABC() ----<< USES ()
3. Re: Calling a procedure
Works for me. What is the error message you are getting?
jbrown
On Sat, Jul 05, 2003 at 01:01:07AM +0000, jondolar wrote:
>
>
> Derek Parnell wrote:
> >
> >
> > ----- Original Message -----
> > From: "jondolar" <lavigne.s at videotron.ca>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Saturday, July 05, 2003 10:06 AM
> > Subject: Calling a procedure
> >
> >
> > > Hi everybody. Another newbie question. Here is a bit of code....
> > >
> > > include get.e
> > > object x,i
> > > x = "Jos"
> > > procedure ABC()
> > > position (10,10)
> > > puts(1,x)
> > > puts (1,"\n")
> > > i = wait_key()
> > > end procedure
> > >
> > > ABC
> > >
> > > This does not work. I just see the console window briefly with nothing
> > > on it. Yet If I remove procedure...end procedure, it works perfectly.
> > > This must be very simple. Sorry to waist your time
> > >
> >
> > To call the procedure named "ABC" you need to say "ABC()". In your
> > example
> > you just have "ABC" after the "end procedure" line, without the
> > parenthesis.
> >
> >
> > include get.e
> > object x,i
> > x = "Jos"
> > procedure ABC()
> > position (10,10)
> > puts(1,x)
> > puts (1,"\n")
> > i = wait_key()
> > end procedure
> >
> > ABC() ----<< USES ()
> >
> > It stil doesn't work (with Parenthesis)
>
> arghh
> >
> >
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>
--
/"\ ASCII ribbon | http://www.geocities.com/jbrown1050/
\ / campain against | Linux User:190064
X HTML in e-mail and | Linux Machine:84163
/*\ news, and unneeded MIME | http://verify.stanford.edu/evote.html
4. Re: Calling a procedure
----- Original Message -----
From: "jondolar" <lavigne.s at videotron.ca>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Calling a procedure
[snip]
> >
> > include get.e
> > object x,i
> > x = "Jos"
> > procedure ABC()
> > position (10,10)
> > puts(1,x)
> > puts (1,"\n")
> > i = wait_key()
> > end procedure
> >
> > ABC() ----<< USES ()
> >
> It stil doesn't work (with Parenthesis)
>
> arghh
Let me get this straight.
a) You create a text file called "test.ex".
b) The file "test.ex" contains these eleven lines...
include get.e
object x,i
x = "Jos"
procedure ABC()
position (10,10)
puts(1,x)
puts (1,"\n")
i = wait_key()
end procedure
ABC()
c) After saving the file you start up the DOS command window.
d) At the DOS prompt, you set the correct directory - where you saved the
file to.
e) You then type in "ex test.ex" at the DOS command prompt.
f) And then ??? what happens - EXACTLY.
When I do this I get the word "Jos" appearing at line 10, column 10. It then
waits til I press a key. Then I get a DOS prompt.
--
Derek
5. Re: Calling a procedure
Hi everybody
Remember I mentioned that the the program test did not have the
extention .exw. I renamed it with the extention and yes it runs
perfectly. But one question remains; why the program declared as a
procedure dit not run from the Meditor (not compiling) while the same
program without procedure...end procedure was running perfectly and
produced a program with the proper extention? There lies the mistery!
Any idea?
Thanks
Serge Lavigne
6. Re: Calling a procedure
On Sat, 5 Jul 2003 13:24:02 +0000, jondolar <lavigne.s at videotron.ca>
wrote:
>jondolar wrote:
>I did some further testing and the Meditor behaved differently this=20
>time. In the Meditor I copied the program, opened a new file and pasted=20
>the program then press F5 to run it. This time, Meditor asked to save=20
>the program firs, did it with the proper extention then ran the program=20
>flawlesly. Strange....?
One thing I have just noticed is that MEditor "Save As" refuses to
save a file without a file extension as a file of the same name, with
an extension. Eg if I have created a file "test" (no extension), then
it pointedly refuses to save it as say "test.exw", although it will
save it as say "fred.exw".
Another one I have just noticed is that trying to run a file with no
extension assumes ".ex", and not surprisingly causes an error when the
file.ex cannot be opened.
I'll add these to the list, but meanwhile just make sure you create
files with the correct extension
Regards,
Pete