lua state

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

lua state

Krzysztof Jakubowski
Hi,
I am new here. I need to serialize lua_state. I was searching mailing archives, but all posts were about serializing tables, globals, etc. There is also lua_dump or luaU_dump, but it doesn't solve my problem becouse I need to save "current instruction pointer".
 
I would like to break execution of script (using lua_yield), save the whole state and exit the game. Later I would like to load the state and resume (lua_resume) the execution of script. Is is possible?
 
Is there an explanation of lua_State structure, somewhere?
 
Thanks
Reply | Threaded
Open this post in threaded view
|

RE: lua state

Bilyk, Alex
Hey,
 
I am at exactly the same juncture. To my knowledge there is no experience on this list with saving Lua states. It is possible but a bit of a brute force approach. Basically, the state is just a collection of C structures and, as such, can be saved and restored. I have a hunch it would be hard to get it right, making the code pretty high maintanance. Serializing game object state tables is what I am considering/prototyping at the moment. We don't go dumping raw process memory heaps when saving games written in C, do we? Instead we rely on that the OS will load the executable and we only need to serialize the application state variables. Same line of reasoning may be applied to Lua if you think of Lua VM as a process. Restoring the instruction pointers? Well, same thing, how would you go about this for an application written in C? There is a difference between restoring the game state and the process state.
 
Alex.
 
-----Original Message-----
From: Krzysztof Jakubowski [mailto:[hidden email]]
Sent: Thursday, May 06, 2004 9:07 AM
To: [hidden email]
Subject: lua state

Hi,
I am new here. I need to serialize lua_state. I was searching mailing archives, but all posts were about serializing tables, globals, etc. There is also lua_dump or luaU_dump, but it doesn't solve my problem becouse I need to save "current instruction pointer".
 
I would like to break execution of script (using lua_yield), save the whole state and exit the game. Later I would like to load the state and resume (lua_resume) the execution of script. Is is possible?
 
Is there an explanation of lua_State structure, somewhere?
 
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: lua state

Krzysztof Jakubowski
Thanks for your answer. You are right. But on the other hand I must make
savegames in my game :) I must save the state of almost all game objects and
also the "position of script execution". This is becouse scripts in my game
are not only event-based. Each mission/level has its own script. The main
action goes linearly and so does the script. When script must wait for
something then its execution is stopped using lua_yeild / lua_resume.

Probably I don't need to save the whole state. I can save only globals. Then
I can just reload the original script and load saved globals. The problem is
that I don't want to execute the script from the beginning, but from the
place it was during saving :) It is also possible that it was in nested lua
function or in loop, so that it is not enought to jump to "line"... How to
do it? If the only way is to study hard lua source code, please give me some
hints :)

Thanks
Krzysiek


Reply | Threaded
Open this post in threaded view
|

RE: lua state

Hassink
In reply to this post by Krzysztof Jakubowski
Could you model your script as a state machine and simply save the game state (and any substates)? Then you could feed these states back to the script on startup and it can resume where it left off prior to the save.

Seems simpler than trying to persist and restore the internal VM state of the script itself. It would also decouple your game state from the scripting technology you're using (in case you choose to use something other than Lua in the future).

-Brian


-----Original Message-----
From: Krzysztof Jakubowski [[hidden email]]
Sent: Thursday, May 06, 2004 4:28 PM
To: Lua list
Subject: Re: lua state


Thanks for your answer. You are right. But on the other hand I must make
savegames in my game :) I must save the state of almost all game objects and
also the "position of script execution". This is becouse scripts in my game
are not only event-based. Each mission/level has its own script. The main
action goes linearly and so does the script. When script must wait for
something then its execution is stopped using lua_yeild / lua_resume.

Probably I don't need to save the whole state. I can save only globals. Then
I can just reload the original script and load saved globals. The problem is
that I don't want to execute the script from the beginning, but from the
place it was during saving :) It is also possible that it was in nested lua
function or in loop, so that it is not enought to jump to "line"... How to
do it? If the only way is to study hard lua source code, please give me some
hints :)

Thanks
Krzysiek

Reply | Threaded
Open this post in threaded view
|

RE: lua state

Luiz Henrique de Figueiredo
In reply to this post by Krzysztof Jakubowski
>I need to serialize lua_state.

One simple way to do that is to use memory backed by a persistent file.

I experimented with this idea last year using GNU mmalloc:
	http://lua-users.org/lists/lua-l/2003-07/msg00251.html
but I did not find mmalloc stable. Probably just my fault.

Today I've found LPSM:
	http://freshmeat.net/projects/lpsm/
and it seems to work great! (I tested LPSM 0.1.11 on RH9 Linux.)

This scheme still does not save instruction pointers but you can stop a
Lua session and restart it later with all data intact.

For those who want to try it, get a version of lper at
	http://www.tecgraf.puc-rio.br/~lhf/tmp/lper.tar.gz

I'll do some more testing and if everything seems ok I'll make this the
official lper.

I wonder whether LPSM will run on other Unix platforms...
Also, if anyone here knows how to use GNU mmalloc well, please let me know.

Enjoy.
--lhf

Reply | Threaded
Open this post in threaded view
|

RE: lua state

Bilyk, Alex
In reply to this post by Krzysztof Jakubowski
>This scheme still does not save instruction pointers but you can stop a
>Lua session and restart it later with all data intact.

You are not talking about Lua VM instruction pointer, are you? That is, if one had saved in the suggested fashion Lua VM with a few yielded states in it, it would be possible to resume them after loading that VM back, would it not?

On a side note, this method of serialization would produce platform dependent files... right?.

Alex

>-----Original Message-----
>From: Luiz Henrique de Figueiredo [[hidden email]]
>Sent: Thursday, May 06, 2004 1:49 PM
>To: [hidden email]
>Cc: [hidden email]; [hidden email]
>Subject: RE: lua state
>
>
>>I need to serialize lua_state.
>
>One simple way to do that is to use memory backed by a persistent file.
>
>I experimented with this idea last year using GNU mmalloc:
>	http://lua-users.org/lists/lua-l/2003-07/msg00251.html
>but I did not find mmalloc stable. Probably just my fault.
>
>Today I've found LPSM:
>	http://freshmeat.net/projects/lpsm/
>and it seems to work great! (I tested LPSM 0.1.11 on RH9 Linux.)
>
>
>For those who want to try it, get a version of lper at
>	http://www.tecgraf.puc-rio.br/~lhf/tmp/lper.tar.gz
>
>I'll do some more testing and if everything seems ok I'll make this the
>official lper.
>
>I wonder whether LPSM will run on other Unix platforms...
>Also, if anyone here knows how to use GNU mmalloc well, please 
>let me know.
>
>Enjoy.
>--lhf
>
>

Reply | Threaded
Open this post in threaded view
|

Re: lua state

Edgar Toernig
In reply to this post by Luiz Henrique de Figueiredo
> >I need to serialize lua_state.
> 
> One simple way to do that is to use memory backed by a persistent file.

Is there any Lua-using game without userdata?  At the moment you have
userdata you also have to save the C-data that it references[1].

IMHO trying to serialize complete Lua state is silly.  Nobody wants to
do that with C/C++ - why should it be different with Lua?

Ciao, ET.


[1] Start with the FILE* userdata from the standard iolib *beg*

Reply | Threaded
Open this post in threaded view
|

Re: lua state

Jamie Webb-3
In reply to this post by Krzysztof Jakubowski
On Thursday 06 May 2004 17:07, Krzysztof Jakubowski wrote:
> Hi,
> I am new here. I need to serialize lua_state. I was searching mailing
> archives, but all posts were about serializing tables, globals, etc. There
> is also lua_dump or luaU_dump, but it doesn't solve my problem becouse I
> need to save "current instruction pointer".
>
> I would like to break execution of script (using lua_yield), save the whole
> state and exit the game. Later I would like to load the state and resume
> (lua_resume) the execution of script. Is is possible?

If I really felt the need to implement logic as a single function rather than 
a state machine, I might start thinking about preprocessing the Lua code, 
e.g. to turn this:

    function my_game()
        local x = do_stuff()
        %YIELDPOINT%
        return do_more_stuff(x)
    end

Into this:

    function my_game()
        local x = do_stuff()
        return my_yield(42, x)
    end

    continuations[42] = function(x)
         return do_more_stuff(x)
    end

The simplicity of the Lua grammar makes that not too hard to do (and with care 
you could even avoid screwing up the line numbers for debugging). Provided 
you aren't doing anything funky with function environments, it means that you 
can just save the global table and any locals using standard methods. Doing 
it that way is a lot less fragile than messing about with the Lua internals.

The state machine is the better option though, even if it seems like more 
marginal work. Really.

-- Jamie Webb

Reply | Threaded
Open this post in threaded view
|

coroutines

Eric Jacobs
On Fri, 7 May 2004 01:17:04 +0100
Jamie Webb <[hidden email]> wrote:

> 
> If I really felt the need to implement logic as a single function rather than 
> a state machine, I might start thinking about preprocessing the Lua code, 
> e.g. to turn this:
> 
>     function my_game()
>         local x = do_stuff()
>         %YIELDPOINT%
>         return do_more_stuff(x)
>     end
> 
> Into this:
> 
>     function my_game()
>         local x = do_stuff()
>         return my_yield(42, x)
>     end
> 
>     continuations[42] = function(x)
>          return do_more_stuff(x)
>     end


This is exactly what coroutines do in Lua 5!

This is facilitated by the fact that Lua 5 is built with an interpreter
that is nonrecursive with respect to the C stack. This is a huge advantage
over nearly every other scripting language its class (some exceptions
would be good implementations of Scheme, the now abandoned classic Stackless
Python, and probably some others I'm not aware of.)

One doesn't need a preprocessor to do this, simply use coroutine.yield(),
and fire off the initial function with a call to coroutine.wrap().

:
> The state machine is the better option though, even if it seems like more 
> marginal work. Really.

Coroutines are powerful precisely because they allow one to use code
written as a thread ("synchronous" or "multithreaded" style) as state
machines, implicitly and cleanly.

In fact, Lua coroutines _are_ state machines. They are state machines
which abstract the workings of the Lua VM itself.

Eric

Reply | Threaded
Open this post in threaded view
|

Re: coroutines

Jamie Webb-3
On Friday 07 May 2004 03:07, Eric Jacobs wrote:
> On Fri, 7 May 2004 01:17:04 +0100
>
> Jamie Webb <[hidden email]> wrote:
> > If I really felt the need to implement logic as a single function rather
> > than a state machine, I might start thinking about preprocessing the Lua
> > code, e.g. to turn this:
> >
> >     function my_game()
> >         local x = do_stuff()
> >         %YIELDPOINT%
> >         return do_more_stuff(x)
> >     end
> >
> > Into this:
> >
> >     function my_game()
> >         local x = do_stuff()
> >         return my_yield(42, x)
> >     end
> >
> >     continuations[42] = function(x)
> >          return do_more_stuff(x)
> >     end
>
> This is exactly what coroutines do in Lua 5!

Not quite. The point of the code above is that my_yield can be a Lua function 
which is able to serialise the current state (provided any userdata can be 
serialised). It can then be recovered multiple times, and in different 
instances of the VM.

-- Jamie Webb

Reply | Threaded
Open this post in threaded view
|

Re: lua state

Krzysztof Jakubowski
In reply to this post by Jamie Webb-3
Let's say we have functions defined in C:
    Say(txt, speech)    -- play sound file 'speech' and show message 'txt'
on the screen. Then stop lua until the message is finished
    Wait(time)    -- stop lua for some time

look at this:

(...)
Say("Hey Fox Four, any hot women out there in Aldebaran?", "1.ogg")
Say("I don't think I want to meet any women they got out there.", "2.ogg")
Say("You don't like women with four legs and two heads? Man -", "3.ogg")
Say("One more word and you two are gone from my flight.", "4.ogg")
Wait(5)
    -- let's say that the player is saving game somewhere here
Say("Freedom to all, GE electronic countermeasures detected.", "5.ogg")
Say("Right boys, it's gonna get warm in a minute. No sleeping, no
schlepping.", "6.ogg")
Say("Roger.", "7.ogg")
Wait(3)
    CreateSomeEnemyObjects(...)
Say("Freedom to all, strong group signature growing fast at eighty degrees,
ETA forty.", "8.ogg")
Say("Copy. Sounds like you could use a radical radar upgrade there.",
"9.ogg")
(...)

That way I can construct linear action, dialogues. Imagine the same thing
using machine states. Of course in that case Say() function can't wait. It
just show the message, play the sound and returns.

if state == 1 then
    Say("Hey Fox Four, any hot women out there in Aldebaran?", "1.ogg")
    state = 2
    return
elseif state == 2 then
    Say("I don't think I want to meet any women they got out there.",
"2.ogg")
    state = 3
    return
elseif state == 3 then ..........

Of course using this model I don't need to save the "posiotion of
execution", but how does it look :(? I don't want to use machine states :)

-- Krzysiek Jakubowski

> If I really felt the need to implement logic as a single function rather
than
> a state machine, I might start thinking about preprocessing the Lua code,
> e.g. to turn this:
>
>     function my_game()
>         local x = do_stuff()
>         %YIELDPOINT%
>         return do_more_stuff(x)
>     end
>
> Into this:
>
>     function my_game()
>         local x = do_stuff()
>         return my_yield(42, x)
>     end
>
>     continuations[42] = function(x)
>          return do_more_stuff(x)
>     end
>
> The simplicity of the Lua grammar makes that not too hard to do (and with
care
> you could even avoid screwing up the line numbers for debugging). Provided
> you aren't doing anything funky with function environments, it means that
you
> can just save the global table and any locals using standard methods.
Doing
> it that way is a lot less fragile than messing about with the Lua
internals.
>
> The state machine is the better option though, even if it seems like more
> marginal work. Really.
>
> -- Jamie Webb
>


Reply | Threaded
Open this post in threaded view
|

Re: lua state

Jamie Webb-3
On Friday 07 May 2004 09:01, Krzysztof Jakubowski wrote:
> Let's say we have functions defined in C:
>     Say(txt, speech)    -- play sound file 'speech' and show message 'txt'
> on the screen. Then stop lua until the message is finished
>     Wait(time)    -- stop lua for some time
>
> look at this:

How about this syntax, which can be acheived directly in Lua:

script = Sequence "script_name" {
    Say("Hey Fox Four, any hot women out there in Aldebaran?", "1.ogg");
    Say("I don't think I want to meet any women they got out there.", 
"2.ogg");
    Say("You don't like women with four legs and two heads? Man -", "3.ogg");
    Say("One more word and you two are gone from my flight.", "4.ogg");
    Wait(5);
    Say("Freedom to all, GE electronic countermeasures detected.", "5.ogg");
    Say("Right boys, it's gonna get warm in a minute. No sleeping, no 
schlepping.", "6.ogg");
    Say("Roger.", "7.ogg");
    Wait(3);
    CreateSomeEnemyObjects(...);
    Say("Freedom to all, strong group signature growing fast at eighty 
degrees, ETA forty.", "8.ogg");
    Say("Copy. Sounds like you could use a radical radar upgrade there.", 
"9.ogg");
}

Now the Say and Wait functions return closures which actually do the saying or 
waiting. The Sequence function combines all those closures into a state 
machine. You keep your variables in a table which is passed among the 
closures and can be serialised to save the game state. You can define 
additional operations on these sequence machines which allows them to be 
composed in more complex ways, variations on the machine structure designed 
for dialog, etc. The key here is to think declaratively rather than 
procedurally. You get a lot more flexibility that way.

-- Jamie Webb

Reply | Threaded
Open this post in threaded view
|

Re: lua state

Grisha
I encountered the same problem, and though it wasn't actually solved there
are some ideas on how it could be made.

First I'd state that yes, it would be very convinient for everyone if such
system existed. In our game (worth about 40Mb in C++ code) we use full
serialization to save game state during the mission, and I think similar
approach can be used for Lua.

Main problems:
1. how to limit serialized part of the state to exclude libraries and other
'static' parts.
2. how to serialize C-functions (some kind of wrapper will be needed
probably)
3. how to serialize userdata (it's simplier - just use callback
serialize_udata(void *data, unsigned size) )

with exclusion of these, Lua state can be serialized by generic
serialization techniques (we use factories and object enumeration)
all constructive ideas are welcome :)

with respect,
Grisha


Reply | Threaded
Open this post in threaded view
|

Re: lua state

benjamin sunshine-hill
I have the top-level design for a serialization system on my desk, waiting for 
a free weekend.

> Main problems:
> 1. how to limit serialized part of the state to exclude libraries and other
> 'static' parts.
> 2. how to serialize C-functions (some kind of wrapper will be needed
> probably)

Under my design, the serializer would take, as input, an array of lua objects 
that are part of the underlying framework and should not be serialized. The 
deserializer takes the same array, in the same order, and remakes the links 
as necessary. 

Tricky issues I haven't dealt with yet:

1. How to merge preexisting and new indices in the registry.
2. How to deal with framework-members with links to non-framework members.

Ben

-- 
Ben Sunshine-Hill
Student and Programmer
Your lucky words for today: who, moaned, and cityscape.


Reply | Threaded
Open this post in threaded view
|

RE: lua state

Anton Krugliakov
In reply to this post by Krzysztof Jakubowski
Hi!

We are using lua with serialization, but ... we using hardly modified version of Lua 4.1 totaly rewrited to use STL and coroutines, because our automatic serialization method understand only STL containers. But, now we can't move to Lua 5.x because of making it's serializable is a very hard work :(
I'd like to hear if someone make Lua 5.x serializable ?
Or is all on this thread use state machine instead of full serialization ?

WBR
--
_________________________
Anton Krugliakov
Programmer
Nival Interactive
[hidden email]
http://www.nival.com

Reply | Threaded
Open this post in threaded view
|

RE: lua state

Bilyk, Alex
In reply to this post by Krzysztof Jakubowski
So, by 'serializable' you mean that in your app you can say something to the tune of 

lua_State* L = <...>
storage_object = save(L)
L =  load(storage_object)

I would like to know what had constituted the bulk of your hard work on serialization code and where does STL come in with respect to serialization? I am working on serialization code right now and so far not considering any brute force methods (like using a persistent memory or just dumping internal lua structures to a file).

Thanks,
Alex


>-----Original Message-----
>From: Anton Krugliakov [[hidden email]]
>Sent: Monday, May 10, 2004 5:26 AM
>To: [hidden email]
>Subject: RE: lua state
>
>
>Hi!
>
>We are using lua with serialization, but ... we using hardly modified 
>version of Lua 4.1 totaly rewrited to use STL and coroutines, because 
>our automatic serialization method understand only STL containers.
>But, now we can't move to Lua 5.x because of making it's 
>serializable is 
>a very hard work :(
>I'd like to hear if someone make Lua 5.x serializable ?
>Or is all on this thread use state machine instead of full 
>serialization ?
>
>WBR
>-- 
>_________________________
>Anton Krugliakov
>Programmer
>Nival Interactive
>[hidden email]
>http://www.nival.com
>
>

Reply | Threaded
Open this post in threaded view
|

Re: lua state

Anton Krugliakov
Bilyk, Alex wrote:
So, by 'serializable' you mean that in your app you can say something to the tune of
lua_State* L = <...>
storage_object = save(L)
L =  load(storage_object)

Something like this


I would like to know what had constituted the bulk of your hard work on serialization code and where does STL come in with respect to serialization? I am working on serialization code right now and so far not considering any brute force methods (like using a persistent memory or just dumping internal lua structures to a file).

Our serializator has one method "Add", that using overloading and template specialization to deduce what kind of data you want to save. Of course serialization of raw pointers is imposible, so you need containers(STL) or special IUnknown-like object, that can give information about yourself.

We rewrited Lua to STL/our object system, but now we can't upgrade to newest lua ... And i'm looking for methods, that will not change core lua and work on top of it. Any ideas ?
What kind of serialization are you working about ?


-----Original Message-----
From: Anton Krugliakov [[hidden email]]
Sent: Monday, May 10, 2004 5:26 AM
To: [hidden email]
Subject: RE: lua state


Hi!

We are using lua with serialization, but ... we using hardly modified version of Lua 4.1 totaly rewrited to use STL and coroutines, because our automatic serialization method understand only STL containers. But, now we can't move to Lua 5.x because of making it's serializable is a very hard work :(
I'd like to hear if someone make Lua 5.x serializable ?
Or is all on this thread use state machine instead of full serialization ?

WBR
--
_________________________
Anton Krugliakov
Programmer
Nival Interactive
[hidden email]
http://www.nival.com






--
_________________________
Anton Krugliakov
Programmer
Nival Interactive
[hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: lua state

Bilyk, Alex
In reply to this post by Krzysztof Jakubowski
Well, we do use IUnknown and other COM-like features and so I can serialize any userdata my scripts are using. As to serialization in general, it's just going to be dumping some tables to a file and then reading them back... trying to figure out the versioning scheme at the moment. I have an OOP framework written in Lua and so I intend to simply persist all class instances created in the game, pretty much the way we do it for things written in C++. 

Alex

>-----Original Message-----
>From: Anton Krugliakov [[hidden email]]
>Sent: Tuesday, May 11, 2004 1:16 AM
>To: Lua list
>Subject: Re: lua state
>
>
>Bilyk, Alex wrote:
>> So, by 'serializable' you mean that in your app you can say 
>something to the tune of 
>> 
>> lua_State* L = <...>
>> storage_object = save(L)
>> L =  load(storage_object)
>
>Something like this
>
>> 
>> I would like to know what had constituted the bulk of your 
>hard work on serialization code and where does STL come in 
>with respect to serialization? I am working on serialization 
>code right now and so far not considering any brute force 
>methods (like using a persistent memory or just dumping 
>internal lua structures to a file).
>
>Our serializator has one method "Add", that using overloading and 
>template specialization to deduce what kind of data you want to save.
>Of course serialization of raw pointers is imposible, so you need 
>containers(STL) or special IUnknown-like object, that can give 
>information about yourself.
>
>We rewrited  Lua to STL/our object system, but now we can't upgrade to 
>newest lua ...
>And i'm looking for methods, that will not change core lua and work on 
>top of it. Any ideas ?
>What kind of serialization are you working about ?
>
>> 
>>>-----Original Message-----
>>>From: Anton Krugliakov [[hidden email]]
>>>Sent: Monday, May 10, 2004 5:26 AM
>>>To: [hidden email]
>>>Subject: RE: lua state
>>>
>>>
>>>Hi!
>>>
>>>We are using lua with serialization, but ... we using hardly 
>modified 
>>>version of Lua 4.1 totaly rewrited to use STL and 
>coroutines, because 
>>>our automatic serialization method understand only STL containers.
>>>But, now we can't move to Lua 5.x because of making it's 
>>>serializable is 
>>>a very hard work :(
>>>I'd like to hear if someone make Lua 5.x serializable ?
>>>Or is all on this thread use state machine instead of full 
>>>serialization ?
>>>
>>>WBR
>>>-- 
>>>_________________________
>>>Anton Krugliakov
>>>Programmer
>>>Nival Interactive
>>>[hidden email]
>>>http://www.nival.com
>>>
>>>
>> 
>> 
>> 
>
>-- 
>_________________________
>Anton Krugliakov
>Programmer
>Nival Interactive
>[hidden email]
>
>

Reply | Threaded
Open this post in threaded view
|

Tracking table access

Florian Berger

Hi.

I have previously (http://lua-users.org/lists/lua-l/2003-12/msg00160.html) asked about tracking table access in Lua 5. In my program I’m using Lua table to store data. The table contains sub tables inside sub tables etc.

My idea is to make data table to analyze it’s contents automatically. The analysis is then used later on. Currently I’m doing the analysis by recursively going through the whole table when changes happen. I thought that tracking table access could be more efficient because in case of changes in data table I only have to track modifications of table and don’t have to analyze whole table again. Usually the changes in data table are small but the table itself is big. I require more than just info that table is being accessed.

Simple example of tracking of table access:
local index = {}

local mt =
{
  __index = function(t, k)
    print('*access of element ' .. tostring(k))
    return t[index][k]
  end,

  __newindex = function(t, k, v)
    print('*update of element ' .. tostring(k) .. ' to ' .. tostring(v))
    t[index][k] = v
  end
}

function track(t)
  local proxy = {}
  proxy[index] = t
  setmetatable(proxy, mt)
  return proxy
end

t = {}
t = track(t)

t[1] = 'a'	--> *update of element 1 to a
print(t[1])	--> *access of element 1
	--> a

t.x =
{
  y = 'y',
  z = {1, 2, 3},
}	--> *update of element x to table: 00619110

The problem is that this implementation does not track sub tables access. And for analyze to work I need to track all access. Even if I add metatable to all tables when they are added I cannot track all the things happening in the previous “t.x = ...” example.

I’d like to hear your opinions and suggestions. Perhaps somebody has already implemented something similar?

floru