Page 1 of 1

[22 Apr 2008] Question obout DOS Library

Posted: Sat Jun 13, 2020 5:31 pm
by Allanon
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 22 Apr 2008 09:47:11 -0000

Hello, I was wondering if there is a method to open files in a dynamic way like in LUA? In Hollywood I have to assign an <id> for every file I want to open, but if I have several open/close operation in random order I have to track on my own which id's are free and which are in use; in LUA this is not necessary because opening a file returns an handler that can be freed later. Now it can be very usefull if OpenFile without <id> argument (passing <nil> as <id>) could allocate an id for you returning it as result of the function, freeing the programmer from building functions to track down <id> with a table resulting in a much more simple and fast code. I hope you have understood my "weird" english, sorry about that [:)]

Regards, Fabio.

[26 Apr 2008] Re: Question obout DOS Library

Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 26 Apr 2008 16:29:08 +0200
Hello, I was wondering if there is a method to open files in a dynamic way like in LUA?
No, it's not possible. You always have to specify your own IDs.
In Hollywood I have to assign an <id> for every file I want to open, but if I have several open/close operation in random order I have to track on my own which id's are free and which are in use; in LUA this is not necessary because opening a file returns an handler that can be freed later. Now it can be very usefull if OpenFile without <id> argument (passing <nil> as <id>) could allocate an id for you returning it as result of the function, freeing the programmer from building functions to track down <id> with a table resulting in a much more simple and fast code. I hope you have understood my "weird" english, sorry about that [:)]
Yes, I understand what you mean. Currently, there are no plans to change this behaviour because it would mean significant restructuring of the internal object handler of Hollywood. But maybe Hollywood will support it someday. Until then, track your IDs! :-)

[26 Apr 2008] Re: Question obout DOS Library

Posted: Sat Jun 13, 2020 5:31 pm
by Allanon
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 26 Apr 2008 17:25:08 -0000
Yes, I understand what you mean. Currently, there are no plans to change this behaviour because it would mean significant restructuring of the internal object handler of Hollywood. But maybe Hollywood will support it someday. Until then, track your IDs! :-)
Ok, thank you for the answer, I will track my IDs ;) (to be honest I'm already tracking my IDs :-D )