Cleaning up stuff -

John Esak john at valar.com
Wed Oct 28 08:11:22 PDT 2009


In the spirit of Nancy's good suggestion. I'll throw in something.  Let's
see, slashes vs backslashes.

There is a simple rule regarding the "cmd" functioning and slashes versus
backslashes... But if you don't want to remember when you can and can't use
one or the other, you can do something like this. I put a couple lines in
the global setup of every processing table I write. (You may remember a few
years ago I told Bob Stockler that I had made an unbreakable promise to
myself to write every single table I write to be compatible on either *nix
or Windows. It has greatly uncomplicated my programming life.)


     if: @os ne "DOS"
   then: declare global slash(1,,g), nul(10,,g);  slash="/";
nul="/dev/null"
     if: @os eq "DOS"
   then: slash=chr("92");  nul="NUL"


Then anywhere after these two lines have been encountered, you can/must use
the variable slash for building any paths.  And you can use the variable nul
to redirect any output when you want it sent to the bit bucket.  So you can
do:

    then: declare SysCmd;  SysCmd="copy /Y" < path-to-dir { slash {
name-of-file < "2>" { nul { ""
    then: system SysCmd

You can extend the use of the slash all over, using one variable to build
another. Like:

    then: declare fp_stuff(128,,g), cur_fpdir(128,,g), cur_fpprog(128,,g),
path-to-map, name-of-fpfile
    then: fp_stuff=getenv("PFDATA") { slash getenv("PFDIR") { ""
    then: cur_fpdir=fp_stuff { slash { "filepro" { ""
    then: cur _fpprog=fp_stuff { slash { "fp" { ""
    then: path-to_map=cur_fpdir { slash { name-of-fpfile { "map" { ""

Anyway, you get the point.

Why do I always put a { "" at the end of building any expression?  Just
because.  :-)  Just because it has saved me untold hassle the few times when
it is absolutely required and I haven't got it. Take my word for it, this is
a good tip, and really can never hurt anything.

John

P.S. - Maybe Ken will chime in with the simple rule about when filePro
requires a slash versus backslash and really how that is related to the
"cmd" shell interpreter. On *nix, I just use "/" entirely.

I've left the following because I think you'll all get a kick out of it....
This is what I see after I lapse off into a dead sleep or senior moment for
a moment.... I get all d's or s's :-).  Very embarassing when someone walks
in your office and says "Hey John are you sleeping and you say, "No, why do
you ask?". They point to your screen and walk out of the room chuckling. :-)
)

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddd




> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com 
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
m] On Behalf Of Nancy Palmquist
> Sent: Wednesday, October 28, 2009 9:51 AM
> To: 'filePro List'
> Subject: Re: Cleaning up stuff -
> 
> Ryan Powers wrote:
> >> I can clean out the files but
> >> system "rmdir P:\PCL\20091027" will not work.
> >>     
> >
> >
> > You could try "rmdir /q/s P:\PCL\20091027". The "q" will skip the
> > confirmation prompt. It's identical to 'nix "rm -rf somedir".
> >   
> Ryan and Ken gave me great ideas.
> 
> I added the pause Ken suggested and the /q/s that Ryan suggested.
> 
> I discovered that my pathname in this command needed to have 
> the slashes 
> flipped.  In my experience, many commands do not care if the 
> forward or 
> back slash are used, but this one did.  I usually use the backslashes 
> for all windows stuff, but did not bother flipping them on 
> this process, 
> since everything else had worked without backslashes.
> 
> Thanks, once again for the help.
> 
> I guess I better be more careful of the backslashes.
> 
> Nancy
> 
> -- 
> Nancy Palmquist 		MOS & filePro Training Available
> Virtual Software Systems	Web Based Training and Consulting	
> PHONE: (412) 835-9417		   Web site:  http://www.vss3.com
> 
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 



More information about the Filepro-list mailing list