1. [E - 19 to 20 May 1998 (#1998-7)] Command Line Length

On Thu, 21 May 1998 00:00:17 -0400, Terry Constant
<constant at FLASH.NET> wrote:=20

>4Dos allows a command-line length of 255 characters, 511 after expansion
>of environment variables.

>Apparently Euphoria limits the command-line to the Dos length of 128.

>I need to use the longer 4Dos command-line. Is there a way around this
>limitation in Euphoria?

Read the environment variable CMDLINE, rather than using the
Euphoria function command_line().

>If not, would it be possible to lengthen the command-line that Euphoria
>accepts in a future (fairly soon I hope) update/release?

I think this should be done under any circumstances.
--
Jeff Zeitlin
jeff.zeitlin at mail.execnet.com

new topic     » topic index » view message » categorize

2. Re: [E - 19 to 20 May 1998 (#1998-7)] Command Line Length

Jeff,
Thanks for the reply. Two things.

1. For the information to be in CMDLINE, the information has to be on
the command line that calls the Euphoria program. When this command line
gets bigger than 128, Euphoria crashes. There is not a way to get the
long line in CMDLINE without crashing the Euphoria program.

2. However, you sparked an idea in me. I could assign the arguments of a
long command line to any variable I choose. But then I would have to
parse the line instead of it already being in a nice and neat sequence
for me. All in all, I could do it, but this is a real kludge work
around. But, if all else fails, this idea that you sparked would work.

Jeff Zeitlin wrote:
>
> On Thu, 21 May 1998 00:00:17 -0400, Terry Constant
> <constant at FLASH.NET> wrote:
>
> >4Dos allows a command-line length of 255 characters, 511 after expansion
> >of environment variables.
>
> >Apparently Euphoria limits the command-line to the Dos length of 128.
>
> >I need to use the longer 4Dos command-line. Is there a way around this
> >limitation in Euphoria?
>
> Read the environment variable CMDLINE, rather than using the
> Euphoria function command_line().
>
> >If not, would it be possible to lengthen the command-line that Euphoria
> >accepts in a future (fairly soon I hope) update/release?
>
> I think this should be done under any circumstances.
> --
> Jeff Zeitlin
> jeff.zeitlin at mail.execnet.com

--
Terry Constant
constant at flash.net

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

3. Re: [E - 19 to 20 May 1998 (#1998-7)] Command Line Length

On Sat, 23 May 1998 00:00:02 -0400, Terry Constant
<constant at FLASH.NET> wrote:

>1. For the information to be in CMDLINE, the information has to be on
>the command line that calls the Euphoria program. When this command line
>gets bigger than 128, Euphoria crashes. There is not a way to get the
>long line in CMDLINE without crashing the Euphoria program.

I see; I misunderstood - your program is crashing on entry, not
when you call command_line(), is that correct?  I thought
otherwise.  You are, however, correct about the relationship
between CMDLINE and program execution; I apologize for my
misapprehension.

>2. However, you sparked an idea in me. I could assign the arguments of a
>long command line to any variable I choose. But then I would have to
>parse the line instead of it already being in a nice and neat sequence
>for me. All in all, I could do it, but this is a real kludge work
>around. But, if all else fails, this idea that you sparked would work.

The following function (untested) might help - it takes any
sequence that has spaces in it and returns a sequence of
sequences, each item in the returned sequence being a "word" from
the original sequence.

function read_parse(sequence s)
  sequence p
  integer l

  p =3D {}
  while length(s) > 0
    l =3D find(' ',s)
    if l =3D 0 then
      l =3D length(s) + 1
    end if
    p =3D append(p,s[1..l-1])
    s =3D s[l..length(s)]
    if length(s) > 0 then
      s =3D s[2..length(s)]
    end if
  end while
  return p
end function

If my brain ever starts functioning again, I'll make another cut
at this, to handle quoted strings as well.
--
Jeff Zeitlin
jeff.zeitlin at mail.execnet.com

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

4. Re: [E - 19 to 20 May 1998 (#1998-7)] Command Line Length

Jeff,
Thanks for the reply.

Yes, Euphoria crashes before it ever starts. And crashes badly. You
probably missed a previous reply to Robert in which I attached the
Cw.err that is created. It is a long and nasty looking document.

Thanks for the code snippet. If it looks like I will have to use this
workaround, it will save some time. Sometime in the near future I will
work with it, regardless. If I turn up something interesting or come up
with a worthy enhancement to it, I will report back to you.

Again, thanks.

Jeff Zeitlin wrote:
>
> On Sat, 23 May 1998 00:00:02 -0400, Terry Constant
> <constant at FLASH.NET> wrote:
>
> >1. For the information to be in CMDLINE, the information has to be on
> >the command line that calls the Euphoria program. When this command line
> >gets bigger than 128, Euphoria crashes. There is not a way to get the
> >long line in CMDLINE without crashing the Euphoria program.
>
> I see; I misunderstood - your program is crashing on entry, not
> when you call command_line(), is that correct?  I thought
> otherwise.  You are, however, correct about the relationship
> between CMDLINE and program execution; I apologize for my
> misapprehension.
>
> >2. However, you sparked an idea in me. I could assign the arguments of a
> >long command line to any variable I choose. But then I would have to
> >parse the line instead of it already being in a nice and neat sequence
> >for me. All in all, I could do it, but this is a real kludge work
> >around. But, if all else fails, this idea that you sparked would work.
>
> The following function (untested) might help - it takes any
> sequence that has spaces in it and returns a sequence of
> sequences, each item in the returned sequence being a "word" from
> the original sequence.
>
> function read_parse(sequence s)
>   sequence p
>   integer l
>
>   p = {}
>   while length(s) > 0
>     l = find(' ',s)
>     if l = 0 then
>       l = length(s) + 1
>     end if
>     p = append(p,s[1..l-1])
>     s = s[l..length(s)]
>     if length(s) > 0 then
>       s = s[2..length(s)]
>     end if
>   end while
>   return p
> end function
>
> If my brain ever starts functioning again, I'll make another cut
> at this, to handle quoted strings as well.
> --
> Jeff Zeitlin
> jeff.zeitlin at mail.execnet.com

--
Terry Constant
constant at flash.net

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

Search



Quick Links

User menu

Not signed in.

Misc Menu