Page 1 of 1

FinishDirectory()

Posted: Sat Dec 09, 2006 10:39 pm
by Psychophanta
Rename FinishDirectory() function as FreeDirectory() for syntactic coherence, please :)

Posted: Sat Dec 09, 2006 11:11 pm
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()

Posted: Sat Dec 09, 2006 11:18 pm
by AND51
We had this thread before, TS-Soft already requested that!

Posted: Sun Dec 10, 2006 7:34 pm
by Fred
In PB, each word has it's balanced opposite:

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

Posted: Sun Dec 10, 2006 7:41 pm
by Psychophanta
I see now, thanks :wink:

Posted: Sun Dec 10, 2006 8:50 pm
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)
:?:

Posted: Sun Dec 10, 2006 8:59 pm
by Trond
@Psychophanta's deleted post: Then there would be a problem with OpenFile()

Posted: Sun Dec 10, 2006 9:03 pm
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:

Posted: Mon Dec 11, 2006 12:48 pm
by Tranquil

Posted: Mon Dec 11, 2006 12:50 pm
by Psychophanta

Posted: Mon Dec 11, 2006 7:47 pm
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 ;).

Posted: Tue Dec 12, 2006 11:27 pm
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: