1. 2.5 command_line() BUG

Hi all,

         When I type "ex" or "exwc", getting the "file name to execute?" 
prompt, and then type the name of a program, 2.5 beta command_line() 
returns a 1 element sequence containing only the name of the interpreter.

e.g.,

-- CMD.EX
include misc.e

pretty_print(1, command_line(), {2})  puts(1, "\n\n")


----------------------------------------------------------------------------------------------------------------
[G:\EEE]ex
Euphoria Interpreter 2.5 beta for 32-bit DOS.
Copyright (c) Rapid Deployment Software 2005
Permission is freely granted to anyone to copy and
redistribute this Public Domain Edition of Euphoria.

file name to execute? cmd

{
   "M:\EUPHORIA\BIN\EX.EXE"
}

[G:\EEE]
----------------------------------------------------------------------------------------------------------------
This caused a program of mine to crash with
         "subscript value 2 is out of bounds, reading from a sequence of 
length 1"
because it assumed at least a 2 element sequence as per 
documentation.  Under 2.4, you get the name of your program as the second 
element.

This is probably a fault in the C back end because it doesn't happen under 
EU.EX.  It looks like the input returned from the interpreter's prompt 
routine is not being parsed.


Also, watch this:


----------------------------------------------------------------------------------------------------------------
[G:\EEE]ex
Euphoria Interpreter 2.5 beta for 32-bit DOS.
Copyright (c) Rapid Deployment Software 2005
Permission is freely granted to anyone to copy and
redistribute this Public Domain Edition of Euphoria.

file name to execute? cmd first second third

Can't open cmd first second third.ex

[G:\EEE]
----------------------------------------------------------------------------------------------------------------

While this is nothing new, the fact that command_line() returns anything 
implies, to me at least, that what I type at EU's prompt (not the DOS 
prompt) should be treated as a whole command line including arguments.  I'm 
not asking for this behavior to change but I think it should be clarified 
in the docs.

Also, if you leave off the extension, under 2.4, typing "cmd" at the DOS 
prompt, command_line() returns exactly what you typed but at EU's prompt 
you get "cmd.ex"; i.e. after EU adds the extension. This is just a very 
minor inconsistency.

I've tested this under Windows 2000 and straight DOS 7.1.  Please see if 
you can reproduce this.

         Thanks,

         Bob



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.5 - Release Date: 2/3/2005

new topic     » topic index » view message » categorize

2. Re: 2.5 command_line() BUG

Bob Elia wrote:
>          When I type "ex" or "exwc", getting the "file name to execute?" 
> prompt, and then type the name of a program, 2.5 beta command_line() 
> returns a 1 element sequence containing only the name of the interpreter.

Thanks. I'll look into this.
I think it's because in 2.5 the front and back ends are split,
and it isn't easy for the front end to dynamically change 
what command_line(), a back-end routine, sees.
I'll try to make it compatible with 2.4 if it's
not too difficult.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu