CW2.003 - how to delete a file? 
Author Message
 CW2.003 - how to delete a file?

Folks, I'm SURE I've overlooked something elementary, but, I want to
write a little routine that will delete my program's INI file, so that
when the user (or CW) screws up the positioning of a window - I can
tell the user to select the routine - and everything will drop back to
the program default values..

SO - I looked at REMOVE(label) - it needs a label, not a filename.. I
looked at RENAME(label,'filename') - same problem.

Any ideas aside from a batch file (messy solution)?...

TIA!

====================================
        Don Eilenberger

====================================
NOTE - above is a no-spam sig.. replace "^" with
"_" to email to me!
====================================



Sat, 13 May 2000 03:00:00 GMT  
 CW2.003 - how to delete a file?

Hi

Just write the sections being modiefied back to the INI file as blank :

PUTINI('asdfaF','ASDFAS', ,'ASDFAS')

This will make the program revert back to the defaults

Hope it helps

Ciao

Quote:

>Folks, I'm SURE I've overlooked something elementary, but, I want to
>write a little routine that will delete my program's INI file, so that
>when the user (or CW) screws up the positioning of a window - I can
>tell the user to select the routine - and everything will drop back to
>the program default values..

>SO - I looked at REMOVE(label) - it needs a label, not a filename.. I
>looked at RENAME(label,'filename') - same problem.

>Any ideas aside from a batch file (messy solution)?...

>TIA!

>====================================
>        Don Eilenberger

>====================================
>NOTE - above is a no-spam sig.. replace "^" with
>"_" to email to me!
>====================================



Sat, 13 May 2000 03:00:00 GMT  
 CW2.003 - how to delete a file?

SETINI and PUTINI would be better solutions.

--
Russell B. Eggen
Topspeed Corporation

[Using MS Outlook]

|Folks, I'm SURE I've overlooked something elementary, but, I want to
|write a little routine that will delete my program's INI file, so that
|when the user (or CW) screws up the positioning of a window - I can
|tell the user to select the routine - and everything will drop back to
|the program default values..
|
|SO - I looked at REMOVE(label) - it needs a label, not a filename.. I
|looked at RENAME(label,'filename') - same problem.
|
|Any ideas aside from a batch file (messy solution)?...
|
|TIA!
|
|
|====================================
|        Don Eilenberger

|====================================
|NOTE - above is a no-spam sig.. replace "^" with
|"_" to email to me!
|====================================



Sun, 14 May 2000 03:00:00 GMT  
 CW2.003 - how to delete a file?

Hi Don,


Quote:

>Folks, I'm SURE I've overlooked something elementary, but, I want to
>write a little routine that will delete my program's INI file, so that
>when the user (or CW) screws up the positioning of a window - I can
>tell the user to select the routine - and everything will drop back to
>the program default values..

>SO - I looked at REMOVE(label) - it needs a label, not a filename.. I
>looked at RENAME(label,'filename') - same problem.

 MAP
   MODULE('DELINI.CLW')
     RemoveIni(STRING),LONG
   END
 END

RemoveIni       FUNCTION(pFileName)

Loc:IniFileName   STRING(255),STATIC
IniFile   FILE,DRIVER('DOS'),NAME(Loc:IniFileName)
Record      RECORD
            END
          END

 CODE
 Loc:IniFileName = Clip(pFileName)
 Remove(IniFile)
 Return(ErrorCode())

This should do it:)

Best regards,

Arnor Baldvinsson
Allerup Edb
Tel: +45 4675 7122
Fax: +45 4675 7144
Denmark


http://www.icetips.com
UIN nr.: 2428601



Sun, 14 May 2000 03:00:00 GMT  
 CW2.003 - how to delete a file?

If you checkout pages 343 of the Clarion Clarion Programmers guide you will
see a bunch simple file manipulation functions that are in clarions runtime
library but aren't really documented anyplace else.    One of them is a
delete function.   Put the following in your Global Map.

     MODULE('WinAPi')
        API_Remove(*cstring),short,raw,name('_remove')
     .

Then Just call the API_REMOVE function with a CSTRING containing the
filename of the program you want to delete.   Real Simple.  HTH



Sun, 14 May 2000 03:00:00 GMT  
 CW2.003 - how to delete a file?



Quote:
> Folks, I'm SURE I've overlooked something elementary, but, I want to
> write a little routine that will delete my program's INI file, so that
> when the user (or CW) screws up the positioning of a window - I can
> tell the user to select the routine - and everything will drop back to
> the program default values..

> SO - I looked at REMOVE(label) - it needs a label, not a filename.. I
> looked at RENAME(label,'filename') - same problem.

> Any ideas aside from a batch file (messy solution)?...

You could probably define an ASCII or DOS file with the proper name, and
remove that.

--
For Hire
Tom Ruby
--------------------------------------------------------------------

http://www.netins.net/showcase/tomruby/
Find resources mentioned in this newsgroup:
   http://www.netins.net/showcase/tomruby/clarion/



Sun, 14 May 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. CW2.003 - disable DELETE key on a browse?

2. CW2.003 - file errors on Clarion file - HELP!

3. CW2.003 Copy file changes file date

4. Can't open .app file any more [cw2.003]

5. File Loaded List Box Performance (CW2.003)

6. CW2.003 Invalid Key file...

7. How to copy a Dos file (cw2.003)?

8. CW2.003 Report Writer - Using variable for file path/name

9. clipper files CW2.003

10. CW2.003 & Corrupt File

11. CW2.003 - Changing file path(s)

12. CW2.003 - file backup using Process Template

 

 
Powered by phpBB® Forum Software