DOS PAL 4.0 file delete

DOS PAL 4.0 file delete

Post by Keith John Marba » Thu, 16 Dec 1993 22:56:58




>Is there any way in DOS PAL 4.0 to delete an arbitrary file?
>DELETE removes tables, but I need something more general.

There is a way, but it's pretty slow.  You can use the run command
to execute any DOS program.  For example, RUN "DEL MY.TXT" will
shell out to DOS and delete the file named MY.TXT.

There are probably faster ways, but this one works.

Keith

 
 
 

DOS PAL 4.0 file delete

Post by Dean Bow » Thu, 16 Dec 1993 23:47:32




> Is there any way in DOS PAL 4.0 to delete an arbitrary file?
> DELETE removes tables, but I need something more general.

> Thank you,
> Daniel Lewart


You might want to try a RUN BIG command and use DOS to delete the file.
For example:

RUN BIG "DEL MY_FILE.BAK"

will delete the file "MY_FILE.BAK".  Be sure to include the path if the
file is not in the current directory.


Still hacking ...

 
 
 

DOS PAL 4.0 file delete

Post by Mean Green Dancing Machi » Fri, 17 Dec 1993 00:54:57



Quote:>Is there any way in DOS PAL 4.0 to delete an arbitrary file?
>DELETE removes tables, but I need something more general.

RUN "DEL " + FileName
--

Hugs and backrubs -- I break Rule 6
* vanilla * het

Fortune:
You are an individual interested in forward thrust and the future.

 
 
 

DOS PAL 4.0 file delete

Post by Mean Green Dancing Machi » Fri, 17 Dec 1993 04:28:51



Quote:>Is there any way in DOS PAL 4.0 to delete an arbitrary file?
>DELETE removes tables, but I need something more general.

Oh, yeah, you can also do

EDITOR NEW FileName
WINDOW HANDLE EDITOR TO EdHandle
WINDOW SELECT EdHandle
WINDOW SELECT EdHandle
WINDOW CLOSE

The middle three lines are in case there's a floating window.
--

Hugs and backrubs -- I break Rule 6
* vanilla * het

Fortune:
You are an individual interested in forward thrust and the future.

 
 
 

DOS PAL 4.0 file delete

Post by Karl James Broph » Fri, 17 Dec 1993 15:40:07






>> Is there any way in DOS PAL 4.0 to delete an arbitrary file?
>> DELETE removes tables, but I need something more general.

>You might want to try a RUN BIG command and use DOS to delete the file.

As someone else pointed out, RUN can be slow, and RUN BIG is slower since
more of memory is cleared for the shell.  Using the NOREFRESH option
(ie: RUN NOREFRESH "DEL "+blah ) will eliminate an annoying screen flicker
and may slightly improve speed.  Basically, RUN is the way to go if you
must do this and you should look up all the possible options in a PAL
reference to see what  will suit you best.

As a sidenote on speed, if you are going to be making several deletions
at once, and will always be deleting the same files, using RUN to execute
a batch file will improve performance by reducing the number of times a
new COMMAND shell must be loaded.

Hope it helps...

Karl Brophey                                    | Tellus Consultants, Inc.
Class of '93 Philosophy/Physics                 | 1315 Glenwood Ave N.

"Go, Go, Go You Red, Red, Red!"                       | (612) 374-1422
Remember, it can't be sarcasm if it's the truth!| (612) 374-1301 (Fax)    

 
 
 

DOS PAL 4.0 file delete

Post by Bathsheba Grossm » Sat, 18 Dec 1993 03:50:21








>>> Is there any way in DOS PAL 4.0 to delete an arbitrary file?
>>> DELETE removes tables, but I need something more general.
>>You might want to try a RUN BIG command and use DOS to delete the file.

Slow.

A quicker method that won't work with .exe,.com,.sc2 files, or in modes where
the editor isn't accessible (fname is the file name):

     if isfile(fname) then
          miniedit {new}
          select fname    
          if menuchoice() = "Cancel" then {Replace} endif
          canceledit
     endif

-Sheba

 
 
 

DOS PAL 4.0 file delete

Post by Dean Bow » Sat, 18 Dec 1993 04:04:02





> >Is there any way in DOS PAL 4.0 to delete an arbitrary file?
> >DELETE removes tables, but I need something more general.

> Oh, yeah, you can also do

> EDITOR NEW FileName
> WINDOW HANDLE EDITOR TO EdHandle
> WINDOW SELECT EdHandle
> WINDOW SELECT EdHandle
> WINDOW CLOSE

> The middle three lines are in case there's a floating window.
> --



What the #$!*(% are you trying to code?

The poor soul wanted to delete a file, not open a new editor window and
close it!!!

You deserve a flame!!!

In addition, I would highly suggest that you practice good coding sense by
including comments via the semicolon in your code.  Sometimes it helps to
know what is going, as obviously you don't have a clue to what you are
coding anyway.

Anyway, the correct answer, as I posted before, is to use DOS to delete the
file:

Run Big "Del My_file.txt", where My_file.txt is the name of the file.

Hint:  Be sure to include a path if the file isn't in the current
directory.


Still hacking ...

 
 
 

DOS PAL 4.0 file delete

Post by Bathsheba Grossm » Sat, 18 Dec 1993 14:20:52






>> >Is there any way in DOS PAL 4.0 to delete an arbitrary file?

>> EDITOR NEW FileName
>> WINDOW HANDLE EDITOR TO EdHandle
>> WINDOW SELECT EdHandle
>> WINDOW SELECT EdHandle
>> WINDOW CLOSE

>What the #$!*(% are you trying to code?

[extremely misguided flame deleted]

Quote:>Sometimes it helps to know what is going, as obviously you don't have a
>clue to what you are coding anyway.

Ahem.  One of you doesn't have a clue.  Hint: it isn't Aahz.  This method of
deleting general files is a standard technique documented in the Developer's
Journal.  It works, and much more quickly than "run noshell".  I posted a
variant which does not account for possible floating windows.


>Still hacking ...

That's nice, but keep at it a little longer before you begin flaming pros.

-Sheba

 
 
 

DOS PAL 4.0 file delete

Post by Nasir Ahmed No » Sat, 18 Dec 1993 21:40:09




>>>>Is there any way in DOS PAL 4.0 to delete an arbitrary file?

>> EDITOR NEW FileName
>> WINDOW CLOSE
>What the #$!*(% are you trying to code?

It is very clever way of taking advantage of the fact that EDITOR NEW
will open up the given filename and will overwrite any existing file
of the same name. And then closing an editor session without saving
is same as getting rid of it.

Quote:>You deserve a flame!!!

! ?    :-)

--nasir

 
 
 

DOS PAL 4.0 file delete

Post by Mean Green Dancing Machi » Sun, 19 Dec 1993 01:39:17



>You deserve a flame!!!

Sheba (thank you, oh welding one) and Nasir have already given you a
good roasting.  I'll just note that I've been using Paradox
professionally for over five years.

Quote:>In addition, I would highly suggest that you practice good coding sense by
>including comments via the semicolon in your code.  Sometimes it helps to
>know what is going, as obviously you don't have a clue to what you are
>coding anyway.

Probably would be a good idea for me to comment more, but I figure that
most of the people here assume that a posted answer has some relevance
to the question asked, and try out a short piece of code if they don't
understand it before posting a response.
--

Hugs and backrubs -- I break Rule 6
* vanilla * het

There may or may not be a smiley above.

 
 
 

DOS PAL 4.0 file delete

Post by Dean Bow » Sun, 19 Dec 1993 06:39:49








> >> >Is there any way in DOS PAL 4.0 to delete an arbitrary file?

> >> EDITOR NEW FileName
> >> WINDOW HANDLE EDITOR TO EdHandle
> >> WINDOW SELECT EdHandle
> >> WINDOW SELECT EdHandle
> >> WINDOW CLOSE


> >What the #$!*(% are you trying to code?
> [extremely misguided flame deleted]
> >Sometimes it helps to know what is going, as obviously you don't have a
> >clue to what you are coding anyway.

> Ahem.  One of you doesn't have a clue.  Hint: it isn't Aahz.  This method of
> deleting general files is a standard technique documented in the Developer's
> Journal.  It works, and much more quickly than "run noshell".  I posted a
> variant which does not account for possible floating windows.


> >Still hacking ...

> That's nice, but keep at it a little longer before you begin flaming pros.

> -Sheba

Well, if this is valid code, then how come when I type it in as a script or
procedure, it doesn't run???

I would invite other users to type in the code for themselves, and
hopefully they will not get the message:

Syntax error: Expecting one of :  Form [Design], Report [Design], Current
or Image n

Keep in mind that I typed it in _exactly_ as it reads, and I use Paradox
for DOS 4.0.  Is it that this code is for Paradox for Windows???

And what kind of pro would code without comments??

If the code is valid, then excuse my comments, but it didn't run on my
machine.


Still hacking ...

 
 
 

DOS PAL 4.0 file delete

Post by Dean Bow » Sun, 19 Dec 1993 06:53:39










> > >> >Is there any way in DOS PAL 4.0 to delete an arbitrary file?

> > >> EDITOR NEW FileName
> > >> WINDOW HANDLE EDITOR TO EdHandle
> > >> WINDOW SELECT EdHandle
> > >> WINDOW SELECT EdHandle
> > >> WINDOW CLOSE


> > >What the #$!*(% are you trying to code?
> > [extremely misguided flame deleted]
> > >Sometimes it helps to know what is going, as obviously you don't have a
> > >clue to what you are coding anyway.

> > Ahem.  One of you doesn't have a clue.  Hint: it isn't Aahz.  This method of
> > deleting general files is a standard technique documented in the Developer's
> > Journal.  It works, and much more quickly than "run noshell".  I posted a
> > variant which does not account for possible floating windows.


> > >Still hacking ...

> > That's nice, but keep at it a little longer before you begin flaming pros.

> > -Sheba

> Well, if this is valid code, then how come when I type it in as a script or
> procedure, it doesn't run???

> I would invite other users to type in the code for themselves, and
> hopefully they will not get the message:

> Syntax error: Expecting one of :  Form [Design], Report [Design], Current
> or Image n

> Keep in mind that I typed it in _exactly_ as it reads, and I use Paradox
> for DOS 4.0.  Is it that this code is for Paradox for Windows???

> And what kind of pro would code without comments??

> If the code is valid, then excuse my comments, but it didn't run on my
> machine.


> Still hacking ...

I ran the following code with no bugs:

FILENAME = "MY_FILE.TXT"                  ; where MY_FILE.TXT is a valid
file
EDITOR NEW FILENAME                       ; open a new editor session
WINDOW HANDLE CURRENT TO EDHANDLE         ; get the window handle
WINDOW SELECT EDHANDLE                    ; select the window
WINDOW SELECT EDHANDLE                    ; make sure we have the window
WINDOW CLOSE                              ; close the window

and the bug was fixed.

In closing, I think that people who post code for the Internet should test
their code before posting.  The change I had to make was to make the Window
Handle  "Current" instead of "Editor".

There's nothing I hate more than bad code that won't run.  Maybe the
original code will run in another mode other than Sysmode() = "Main"???

Any enlightening would be appreciated.


Still hacking ...

 
 
 

DOS PAL 4.0 file delete

Post by Dean Bow » Sun, 19 Dec 1993 08:07:28






> >>>>Is there any way in DOS PAL 4.0 to delete an arbitrary file?

> >> EDITOR NEW FileName
> >> WINDOW CLOSE

> >What the #$!*(% are you trying to code?

> It is very clever way of taking advantage of the fact that EDITOR NEW
> will open up the given filename and will overwrite any existing file
> of the same name. And then closing an editor session without saving
> is same as getting rid of it.

> >You deserve a flame!!!

> ! ?    :-)

> --nasir

It might be clever, however, the code that Mr. Aahz posted will not run.  I
pointed this out in my last two follow-up posts.  I suggest that you read
them.  I note that the code you post here is different from the code that
was posted by  Mr. Aahz in his follow-up to the question, and maybe it will
run, however, this does not release Mr. Aahz from the bad code that he
wrote, so my point of "What the #$!*(% are you trying to code?" still
stands, even though the code will work with your version of it.

I rest my case, and hope that in the future, all answers that are posted to
this group have been tested for bugs, because I hate to use code that
doesn't work and isn't documented, as your code doesn't have comments in it
either.  Do you believe in putting comments in your code to help the user
of such code?  Or are you just coding on the fly, without regards to the
user of your code.  I believe that people who use my code should be able to
understand it as much as I do, and the only way to do this is by practicing
good coding standards.

I would invite you to read my post "Suggestions for FAQ - or Posts to this
Group", in which I detail the condition of the code that gets posted to
this group.  If we are "pros" then why do we still not include comments in
our code?  Surely we have learned to practice a habit such as this by now,
or are we all beginners?


Still hacking ...

 
 
 

DOS PAL 4.0 file delete

Post by Nasir Ahmed No » Sun, 19 Dec 1993 12:07:28


May be the points you have raised are ok. But I will say lighten
up. Why are you taking it all too seriously. Aahz happens to be
one of the most knowledgable and helpful pro to visit this group
and your scare tactics will simply keep such people off. Just
remember that this is not a forum where people are paid to solve
problems and neither anyone is bound to solve a problem. Above all,
we are not here to do someone's job for them. All we can quickly do
is sketch out some idea and let the other person work out details.
Also note that we are not writing exams here and nor is our code
intended for direction production.

just take it easy and relax. you also happen to be very helpful
person and that is good. but you have to lighten up a little bit.

no offence was intended so please don't take any. thanks.
--nasir

 
 
 

1. Pdox RUN BIG speed - was DOS PAL 4.0 file Delete

As someone else pointed out, RUN can be slow, and RUN BIG is slower since
more of memory is cleared for the shell.  Using the NOREFRESH option
(ie: RUN NOREFRESH "DEL "+blah ) will eliminate an annoying screen flicker
and may slightly improve speed.  Basically, RUN is the way to go if you
must do this and you should look up all the possible options in a PAL
reference to see what  will suit you best.

As a sidenote on speed, if you are going to be making several deletions
at once, and will always be deleting the same files, using RUN to execute
a batch file will improve performance by reducing the number of times a
new COMMAND shell must be loaded.

Hope it helps...

Karl Brophey                                    | Tellus Consultants, Inc.

But does the speed of RUN BIG as opposed to simply RUN make a difference if
the user has 16 MB of RAM?  I tend to think that the speed of RUN as
opposed to RUN BIG would only matter if the user was using a low RAM
configuration.  Is this so?  In my case:  486/66 Mhz VLB w/16 MB RAM and
256 Kb cache, I don't notice any speed enhancements using RUN as opposed to
RUN BIG.


Still hacking ...

2. SQL*Loader vs Import performance

3. Delete a DOS-file with PAL

4. SET EXPLAIN ON

5. Affordable SQL Software

6. How to delete normal DOS/Files via PAL

7. pdox 4.0(dos) - PAL vs OPAL

8. 4.0 DOS PAL, Accepting memo input via dialog box

9. Pdox 4.0/DOS PAL Dialog Question

10. PAL 4.0 (DOS) question re. LOCATE command