1. Command Line Continuation
I haven't noticed if EU has command line continuation or if you can wrap
a line onto another line. What are the rules to this?
Jim Hendricks
President
Biz Computing, Inc.
2. Re: Command Line Continuation
Jim Hendricks wrote:
>
>
> I haven't noticed if EU has command line continuation or if you can wrap
> a line onto another line. What are the rules to this?
I assume you are not talking about DOS command lines, but about Euphoria
program statements.
The only things that can't continue over multiple lines are text string
literals and commments. For example, below is a valid Euphoria statement...
if thisfld > 0 and
thatfld = 1
then
abc
=
"a very long string that is longer than " &
"a single line of text in the editor"
end
if
--
Derek Parnell
Melbourne, Australia
3. Re: Command Line Continuation
On Sat, 18 Sep 2004 18:27:24 -0700, Jim Hendricks
<guest at RapidEuphoria.com> wrote:
>I haven't noticed if EU has command line continuation or if you can wrap
>a line onto another line. What are the rules to this?
Erm, does this answer your question?
a="a very "&
"long "&
"string"
is the same as
a="a very long string"
or
myProcedure(lots,
and,
lots,
of,
parameters)
is the same as
myProcedure(lots,and,lots,of,parameters)
Eu does not care much about line breaks, except for long strings,
which as shown in the first example, & is required to join them.
In fact, I've indented it for show, you don't have to, but it is
easier to read like that.
One of the most stupid things I ever wasted my time on is the
following program, which should scare you somewhat, but I think it
proves a point
-- goto.exw: usage exw goto.exw <file>
constant togo="goto" type
goto(integer
goto) return
goto=
goto end type type
goto_s(sequence
goto) return equal(
goto,
goto) end type
goto
goto_t,
goto_u procedure
goto_a(
goto
goto)
goto_t+=
goto if
goto then
goto_u=
goto end if end procedure procedure
goto_b(
goto
goto)
goto_u=
goto_u*
goto+1
goto_a(
goto_u=
goto*5) end procedure function
goto_c(
goto
goto)
goto_b(
goto=togo[
goto_u]) return
goto!=-1 end function procedure
goto_d(
goto
goto)
goto_u=
goto!=1
goto_t=
goto=0 while
goto_c(getc(
goto)) do end while close(
goto) printf(1,"%d goto \'s\n",
goto_t) end procedure procedure
goto_x(
goto_s
goto)
goto_d(open(
goto[length(
goto)],"r")) end procedure
goto_x(command_line())
Regards,
Pete
4. Re: Command Line Continuation
> I assume you are not talking about DOS command lines, but about Euphoria
> program statements.
>
> The only things that can't continue over multiple lines are text string
> literals and commments. For example, below is a valid Euphoria statement...
>
> if thisfld > 0 and
> thatfld = 1
> then
> abc
> =
> "a very long string that is longer than " &
> "a single line of text in the editor"
> end
> if
>
>
> --
> Derek Parnell
> Melbourne, Australia
>
Correct assumption, sorry I wasn't clear. Thanks much for the answer
it will be a big help since some of the code I am porting is already
resulting in longer lines than the editor I'm using.
Jim Hendricks
President
Biz Computing, Inc.
5. Re: Command Line Continuation
Hi, Pete!
You wrote:
[snip]
> One of the most stupid things I ever wasted
> my time on is the following program, which
> should scare you somewhat, but I think it
> proves a point
>
> }}}
<eucode>
> -- goto.exw: usage exw goto.exw <file>
> constant togo="goto" type
> goto(integer
> goto) return
> goto=
> goto end type type
> goto_s(sequence
> goto) return equal(
> goto,
> goto) end type
> goto
> goto_t,
> goto_u procedure
> goto_a(
> goto
> goto)
> goto_t+=
> goto if
> goto then
> goto_u=
> goto end if end procedure procedure
> goto_b(
> goto
> goto)
> goto_u=
> goto_u*
> goto+1
> goto_a(
> goto_u=
> goto*5) end procedure function
> goto_c(
> goto
> goto)
> goto_b(
> goto=togo[
> goto_u]) return
> goto!=-1 end function procedure
> goto_d(
> goto
> goto)
> goto_u=
> goto!=1
> goto_t=
> goto=0 while
> goto_c(getc(
> goto)) do end while close(
> goto) printf(1,"%d goto \'s\n",
> goto_t) end procedure procedure
> goto_x(
> goto_s
> goto)
> goto_d(open(
> goto[length(
> goto)],"r")) end procedure
> goto_x(command_line())
> </eucode>
{{{
LOLLLLL!
I think, Rob needs a separate section in his Archive
to keep such the jokes.
Submit it to Rob!
Good Luck!
Regards,
Igor Kachan
kinz at peterlink.ru