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.
[22 Apr 2008] Question obout DOS Library
[22 Apr 2008] Question obout DOS Library
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5833
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[26 Apr 2008] Re: Question obout DOS Library
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 26 Apr 2008 16:29:08 +0200

No, it's not possible. You always have to specify your own IDs.Hello, I was wondering if there is a method to open files in a dynamic way like in LUA?
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!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 [:)]
[26 Apr 2008] Re: Question obout DOS Library
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 26 Apr 2008 17:25:08 -0000
(to be honest I'm already tracking my IDs
)
Ok, thank you for the answer, I will track my IDsYes, 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!![]()
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆