FinishDirectory()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

FinishDirectory()

Post by Psychophanta »

Rename FinishDirectory() function as FreeDirectory() for syntactic coherence, please :)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

A directory cannot be "freed" in a sense that an image is freed. The directory is still there after the call.
Its the same with files, thats why it is called CloseFile() there, not FreeFile()
quidquid Latine dictum sit altum videtur
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

We had this thread before, TS-Soft already requested that!
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

In PB, each word has it's balanced opposite:

Load/Create -> Free
Add -> Remove
Open -> Close
Examine -> Finish
Start -> Stop
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I see now, thanks :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Fred wrote:In PB, each word has it's balanced opposite:

Load/Create -> Free
Add -> Remove
Open -> Close
Examine -> Finish
Start -> Stop

Code: Select all

CreateFile(0, "c:\_test.txt")
CloseFile(0)
:?:
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

@Psychophanta's deleted post: Then there would be a problem with OpenFile()
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I deleted it coz Freak explained why has not sense "FreeFile()" instead of "CloseFile()" :)

If you choose OpenFile(), then you must specify what for (for read, for writing or create new?).
Well, after WriteFile(), ReadFile() or CreateFile() , what would you choose to end it?
Mmmhhh... Can't be perfect :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Tranquil
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Trond wrote:
Fred wrote:In PB, each word has it's balanced opposite:

Load/Create -> Free
Add -> Remove
Open -> Close
Examine -> Finish
Start -> Stop

Code: Select all

CreateFile(0, "c:\_test.txt")
CloseFile(0)
:?:
Well, you got the exception. Basically, if i would add this command now, it would be OpenFile() with a flag. History, history ;).
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

You can do that now easily Fred,
just use PB4's macros to emulate the other file open calls :D

Code: Select all

#PB_File_Open=0
#PB_File_Create=1
#PB_File_Read=2

;OpenFile(#File,FileName$,Flags.l=#PB_File_Open)

Macro ReadFile(file,filename)
 OpenFile(file,filename,#PB_File_Read)
EndMacro

Macro CreateFile(file,filename)
 OpenFile(file,filename,#PB_File_Create)
EndMacro
:lol:
Post Reply