Re: [E - 19 to 20 May 1998 (#1998-7)] Command Line Length
- Posted by Terry Constant <constant at FLASH.NET> May 24, 1998
- 725 views
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