Re: Euphoria 2.4 Featured Bug?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Travis Beaty wrote:
> ex eudoxy/eudoxy
> 
> Note that I entered the path *as though* I were in Linux.  The fact I did
> this didn't dawn on me, because ex located and ran eudoxy.ex despite my
> trans-OS issues. 

DOS/Windows seems to support both forward and backslash
in some cases, although backslash is clearly the standard.
Euphoria is not doing anything special to support this.
After adding ".ex", it just passes your filename,
with forward slash, through to the O/S (and it works).

> However, I became puzzled when the following code produced
> the message "Error:  Could not determine eudoxy.exe's home directory":
> 
> -- start code
> 
> cmd = command_line()
> sWhereAmI = reverse(cmd[2])
> loc = find('\\', sWhereAmI)
> if loc != 0 then
>   sWhereAmI = reverse(sWhereAmI[loc .. length(sWhereAmI)])
> else
>   puts(1, "Error: Could not determine eudoxy.exe's home directory.\n")
>   -- This shouldn't happen.
> end if
> 
> -- end code

command_line() shows you the command line.
If the user types '/', that's what you'll see.

> 1. Cannot assume that the path separator will be "\" in WinDos.

If your program gives an error message to the user
when he types forward slash, I think that's ok.
Users are expected to type backslash on DOS/Windows.

> 2. Cannot assume that the name of a source code file will end with the
> correct Euphoria extension.

".ex", ".exw" etc. are just *conventions*.
They are added automatically when no extension is provided.
If you provide the full filename, with extension, you can
execute any file you like.

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu