[22 Apr 2008] Question obout DOS Library

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

[22 Apr 2008] Question obout DOS Library

Post 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.
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[26 Apr 2008] Re: Question obout DOS Library

Post 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! :-)
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

[26 Apr 2008] Re: Question obout DOS Library

Post 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 )
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
Locked