Re: string handle problem
- From: "slebetman@xxxxxxxxx" <slebetman@xxxxxxxxx>
- Date: 28 Nov 2005 22:19:49 -0800
Bryan Oakley wrote:
> slebetman@xxxxxxxxx wrote:
>
> >>
> >>What platform are you on? This MIGHT be doable using the [file tail]
> >>command, or some other variant of file..
> >>
> >
> >
> > I think it should work regardless of platform. Remember that Tcl
> > normalises file paths to slashes on all platforms.
> >
>
> Though, while it would likely work, it would yield code that is slightly
> more difficult to understand. As a general rule, one should avoid using
> commands on a datatype that were designed for some other datatype, just
> because they happen to work.
Everything's a string ;-) Though I see what you mean.
I think the [lindex [split $x "/"] end] method is simplest (don't know
why the OP think it's complicated compared to regexp). I was just
commenting on the "what platform" and "MIGHT be doable" comment. It IS
doable on any platform.
.
- Follow-Ups:
- Re: string handle problem
- From: Hans
- Re: string handle problem
- References:
- string handle problem
- From: Hans
- Re: string handle problem
- From: MH
- Re: string handle problem
- From: slebetman@xxxxxxxxx
- Re: string handle problem
- From: Bryan Oakley
- string handle problem
- Prev by Date: Re: Getting system uptime on Windows
- Next by Date: The latest Tcl85 failed to load extensions that were linked to the tcl85 and tk85.lib
- Previous by thread: Re: string handle problem
- Next by thread: Re: string handle problem
- Index(es):
Relevant Pages
|