Why am I getting an error here?
GCC Consulting
gccconsulting at comcast.net
Mon Jan 28 13:29:09 PST 2008
> -----Original Message-----
> From: filepro-list-
> bounces+gccconsulting=comcast.net at lists.celestial.com [mailto:filepro-
> list-bounces+gccconsulting=comcast.net at lists.celestial.com] On Behalf
> Of Fairlight
> Sent: Monday, January 28, 2008 2:46 PM
> To: 'filePro'
> Subject: Re: Why am I getting an error here?
>
> On Mon, Jan 28, 2008 at 02:03:42PM -0500, Nancy Palmquist may or may
> not have
> proven themselves an utter git by pronouncing:
> > Apply it to the path part of the command not the instruction part. I
> guess I
> > did not break that down well enough. You are certainly right about
> flags and
> > options and keeping them forward.
> >
> > Thanks for catching that Mark.
>
> You're welcome.
>
> Except "which" path part? Let's assume you have a file with input
> files
> and output files.
>
> C:\> c:/path/to/program.exe /i /rel/absolute/file.in /o e:/abs/file.out
>
> Okay. Tell me which gets translated in the above. From what you said,
> you'd only be translating one part. But there are three parts you want
> translated, two parts you don't. Further, as I illustrate, you don't
> necessarily have an absolute path, you -could- have a relative path--
> which
> would only be distinguishable from a switch in that it has further
> slashes
> later in the string, as you don't have a DRIVELETTER: to rely upon.
>
> It's not just a simple, "One part, not all or nothing," but a very
> specific, "These select parts get translated."
>
> I think the way to go is really to do platform-dependant logic any time
> you create any path individually and before concatenation, if you want
> cross-platform code, rather than try and convert the entire command at
> the
> end. Front-loading the translation to before assembly results in much
> more
> bullet-proof code and far fewer Tylenol consumed.
>
> mark->
The answer to the above problem would be to break down the filename(s) into
variables and the build the command string using these variables.
Declare fiiel_1,file_2,file_3,drive_1,drive_2,drive_3
File_1="/path/to/program.exe";drive_1="c:"
File_2="/rel/absolute/file.in";drive_2=""
File_3="/abs/file.out";drive_3="e:"
Before building the command string below, instr() can be applied to each
file_N variable as needed without affecting the switches.
Ac=drive_1{file_1<"/i<"file_2<"/o<drive_3{file_3
Currently I use something like this to place csv files on specific users
computers by getting the environment variable homepath.
Richard
More information about the Filepro-list
mailing list