Re: Path separators...final

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

don cole wrote:
> 
> Hello Al,
> 
> To start with I made a mistake.
> It should have been:
> 
> }}}
<eucode>
> constant symbal={"`","*","~","@","&"}
> ------------this would be a function returing newPath
> sequence newPath
> newPath=repeat({},2)
> 
>    if findAccent then
>       for x=2  to length(symbal) do
>         tt=testForSymbal[x]
>            if tt=0  then
>             newPath[1]= "`" & replaceAccentsWithSymbal(x) & "`"
>             newPath[2]= symbal[x]--this is the symbal used to replace the non 
>                                  --delimiter accents
>                                  --it will be used to replace non delimiter 
>                                  --accents later on
>             exit
>            end if
>        end for
>     else
>         newPath[1]="`" & line & "`"
>         newPath[2]=0--this is 0 because no accents were replacedend 
>     end if
>    
> 
> > I 'think' i know what you are saying now, but one question i
> > have is...how do you know which 'accents' to replace, for example
> > in this line:
> > 
> >   'c:\mydir\my'file.exe'
> How did the two end accents get in there at this point?
> > 
> > I thought about using the first char (ie the ' here) as delimiter,
> > which would allow different delims for different lines too, but
> > i want the UI to accept the non-delimiter form too like this:
> > 
> >   c:\mydir\my'file.exe
> 
> This would come out 'c:\mydir\my*file.exe'
> 
> 
> Don Cole

Hi Don,

The accents got in there because the user could have typed them
going by the rule that they have to use a delimiter to separate
paths, as in:

  'c:\MyDir\My'File' 'd:\MyDir2\My'File2'

which as you can see wont work because the program wont know which
accent to end the path(s) on.

Keep in mind we could also have this:

  'c:\MyDir\My'File' -' 'd:\MyDir2\My'File2' -'''

which would be strange, but still possible.

What this means is that we have to parse the paths and any arguments
to each path that may be present.

I have other (future) plans to have the UI parse paths BEFORE any
delimiters are needed (so the program can choose perhaps) but
this part of the functionality will still remain intact...ie the
user has the ability to enter the path typed as they see fit,
with delimiters.

Another possibility when there are spaces in the path:

  "c:\MyDir\My 'Other' File" -'a'

Where does the user put the accents in this example, and when a second
path (and arg) follows this one?



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

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

Search



Quick Links

User menu

Not signed in.

Misc Menu