Rename FinishDirectory() to FreeDirectory()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Rename FinishDirectory() to FreeDirectory()

Post by Tranquil »

Hi PB Team.

All commands uses FreeXXXXX Commands to free any PB allocated resources. Only ExamineDirectory uses FinishDirectory().

To be common with all other commands it maybe better to rename this to FreeDirectory() too?

Cheers
Mike
Tranquil
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

Why not use macros until Fred agrees you?

Code: Select all

Macro FreeDirectory(dir)
     FinishDirectory(dir)
Macro
Advantage: No performance-loss, because you use a macro insted of a procedure.


Hast du alles verstanden? :wink:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

All Examine*() functions are closed with Finish*()
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Trond wrote:All Examine*() functions are closed with Finish*()
No, only directory!
CloseDirectory or FreeDirectory is more logical in my head :wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

ts-soft wrote:
Trond wrote:All Examine*() functions are closed with Finish*()
No, only directory!
CloseDirectory or FreeDirectory is more logical in my head :wink:
You are right, it sounds more logicaly.
This was the first time I used the FileSystem Lib of PB. And while coding I wanted to release the #PB_Any allocated Ressources and wondered that FreeDirectory() does not exist.

But anyway, I can also live with FinishDirectory(). :D
Tranquil
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

You sound, as if you didn't pay attention to my post... :cry:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

AND51 wrote:You sound, as if you didn't pay attention to my post... :cry:
I noticed your message, sorry for not replaying to it.
The reason of my posting was only something logical I encountered while coding. Your Macro is surely a workarround for me, but its not really neccessary.

Anyway, thanks for your idea.

Und klaro hab ich Dich verstanden. :D
Tranquil
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

lol, dann ist ja alles im Lot. :D


All in all, I also agree to Tranquils idea renaming FinishDirectory() to FreeDirectory().
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Post Reply