[14 Aug 2009] Feature Request: eval(), etc.
[14 Aug 2009] Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 14 Aug 2009 06:55:21 -0000
1)
I'd really like to have a feature similar to perl's 'eval BLOCK' in order to execute code within 'Block'.
In this way, it would be possible to "dynamically" load code parts or construct them within the code. That's useful for libraries or for parsing and executing the code of "simplified" templates.
2)
Another important feature is to have the possibility to determin the number of "keys" within a table
and
a method which tells you, if a certain "key" is within a table (or is nil).
ListItems() is very limited and only works for tables with keys starting from "0".
(Actually, the concept of a table in Hollywood is more similar to a hashtable and, thus, it would be important to get more information about the keys and values within the table).
Thanks, Tom
1)
I'd really like to have a feature similar to perl's 'eval BLOCK' in order to execute code within 'Block'.
In this way, it would be possible to "dynamically" load code parts or construct them within the code. That's useful for libraries or for parsing and executing the code of "simplified" templates.
2)
Another important feature is to have the possibility to determin the number of "keys" within a table
and
a method which tells you, if a certain "key" is within a table (or is nil).
ListItems() is very limited and only works for tables with keys starting from "0".
(Actually, the concept of a table in Hollywood is more similar to a hashtable and, thus, it would be important to get more information about the keys and values within the table).
Thanks, Tom
[17 Aug 2009] Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 17 Aug 2009 10:53:26 +0200
any change that these features will come?
Tom
any change that these features will come?
Tom
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[17 Aug 2009] Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 17 Aug 2009 22:08:00 +0200

Dynamically loading code can't be supported because it would enable users to write scripts that load & run other scripts and then there would be no difference between the Hollywood full version and the Hollywood player1)
I'd really like to have a feature similar to perl's 'eval BLOCK' in order to execute code within 'Block'.
In this way, it would be possible to "dynamically" load code parts or construct them within the code. That's useful for libraries or for parsing and executing the code of "simplified" templates.
There's currently no function that returns the size of non-linear tables but you can easily determine it by traversing the table using NextItem(). Check the Hollywood doc... it has a nice example. Iterating with NextItem() allows you to obtain all keys of any table.2)
Another important feature is to have the possibility to determin the number of "keys" within a table
and
a method which tells you, if a certain "key" is within a table (or is nil).
ListItems() is very limited and only works for tables with keys starting from "0".
(Actually, the concept of a table in Hollywood is more similar to a hashtable and, thus, it would be important to get more information about the keys and values within the table).
[19 Aug 2009] Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Aug 2009 21:40:21 +0200

So, future release will nothing change here?
Another nice feature would be:
3) "Combining" object to move them on the screen in one shot instead of moving each of them separtely
Thanks for your responds and don't take this as bad criticism to Hollywood. Hollywood is great and I just want to let you know what I'd like to have in addition
My current little Hollywood example codings bring all these things to my mind
Greetings, Tom
ok, that's a good point but also a pity because it restics Hollywood apps somehow. Bye the way, what else than loading und playing hollywood apps does the "Hollywood player"? I can't imagine what you can do with a player if you can't "play" Hollywood scripts.Dynamically loading code can't be supported because it would enable users to write scripts that load & run other scripts and then there would be no difference between the Hollywood full version and the Hollywood player![]()
true, but not very convenient and maybe slow for bigger tablesThere's currently no function that returns the size of non-linear tables but you can easily determine it by traversing the table using NextItem(). Check the Hollywood doc... it has a nice example. Iterating with NextItem() allows you to obtain all keys of any table.
Another nice feature would be:
3) "Combining" object to move them on the screen in one shot instead of moving each of them separtely
Thanks for your responds and don't take this as bad criticism to Hollywood. Hollywood is great and I just want to let you know what I'd like to have in addition
My current little Hollywood example codings bring all these things to my mind
Greetings, Tom
[19 Aug 2009] Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Aug 2009 20:32:10 -0000
This can already be done. See documentation for AddMove().Another nice feature would be:
3) "Combining" object to move them on the screen in one shot instead of moving each of them separtely
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[19 Aug 2009] Re: Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Aug 2009 23:27:08 +0200



The Hollywood Player can only play applets of course. Everything else wouldn't make much sense because then the player would be the full version. The full version can turn source code into applets. The player version can only read these applets then. And applets are safe because they don't contain any source code but precompiled 128bit encrypted highly secure bytecode insteadok, that's a good point but also a pity because it restics Hollywood apps somehow. Bye the way, what else than loading und playing hollywood apps does the "Hollywood player"? I can't imagine what you can do with a player if you can't "play" Hollywood scripts.![]()
Depends. What exactly do you want? Just a function that returns the real number of elements of a non-linear table? Everything else should be possible with NextItem()... if not, give me an exampletrue, but not very convenient and maybe slow for bigger tablesSo, future release will nothing change here?
As Paul already said, you can use AddMove() for that or with Hollywood 4.0 it is even easier using the SetLayerStyle() command.3) "Combining" object to move them on the screen in one shot instead of moving each of them separtely
Sure, don't hesitate to post suggestions. I'm always interested in themThanks for your responds and don't take this as bad criticism to Hollywood. Hollywood is great and I just want to let you know what I'd like to have in addition![]()
[20 Aug 2009] Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Aug 2009 00:39:21 +0200

Of course, I could traverse all the content of the table in order to know if "key" is an element in the table, but this takes time and is not that nice
It would look like this:
This is unconvenient and time consuming, i think?

But how does SetLayerStyle() work? I don't really get how it works (from the documentation). Let's say, I want to move 2 Layers from its current position 10 px to the left (relative to each object's x position) and the movement should work in the way like "MoveLayer()" it does: that is, the movement should be visible and not a jump from one position to the next.
SetLayerStyle() takes as arguments the ID from only one layer, right? And with X,Y I can specify it's new position on the screen, right?
But how can I combine the movement of 2 objects then? And how can I control the movement itself (e.g. the speed)?
At the moment, I use "MoveLayer()" for each Layer I want to move, but then there's a delay between until the last layer has reached its target. I can imagine that AddMove()/DoMove() will do exactly what I want (I will look at it tomorrow more closely), but how can SetLayerStyle() do the job?
Thanks a lot!
Tom
very cleverThe Hollywood Player can only play applets of course. Everything else wouldn't make much sense because then the player would be the full version. The full version can turn source code into applets. The player version can only read these applets then. And applets are safe because they don't contain any source code but precompiled 128bit encrypted highly secure bytecode instead![]()
For example, if i like to know if a certain "key" is set or has a non-null value, it would be convenient to do the following:Depends. What exactly do you want? Just a function that returns the real number of elements of a non-linear table? Everything else should be possible with NextItem()... if not, give me an example![]()
Code: Select all
if (table[key] <> nil) Then do_something Else do_something_else
Code: Select all
Local key, value = NextItem(table)
While GetType(nextptr) <> #NIL
if (key = the_key_I_search)
key_was_found=false;
do_something
break
Endif
key,value = NextItem(table)
Next
If (not key_was_found) Then do_something_else
Ah, yes. AddMove()/DoMove() most likely does the jobAs Paul already said, you can use AddMove() for that or with Hollywood 4.0 it is even easier using the SetLayerStyle() command.
But how does SetLayerStyle() work? I don't really get how it works (from the documentation). Let's say, I want to move 2 Layers from its current position 10 px to the left (relative to each object's x position) and the movement should work in the way like "MoveLayer()" it does: that is, the movement should be visible and not a jump from one position to the next.
SetLayerStyle() takes as arguments the ID from only one layer, right? And with X,Y I can specify it's new position on the screen, right?
But how can I combine the movement of 2 objects then? And how can I control the movement itself (e.g. the speed)?
At the moment, I use "MoveLayer()" for each Layer I want to move, but then there's a delay between until the last layer has reached its target. I can imagine that AddMove()/DoMove() will do exactly what I want (I will look at it tomorrow more closely), but how can SetLayerStyle() do the job?
Thanks a lot!
Tom
[20 Aug 2009] Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Aug 2009 10:04:37 +0200
So, my feature request is still valid, because it would be simply nice to combine objectes and then do somthing like MoveGroupedLayers() in order to move all grouped objects by a certain amount of pixels in x and/or y direction, relative to each object's position. and with the posibility of FX-effects like: #BOUNCE, etc.
Wit AddMove()/DoMove() you have to take care of everything yourself (if I'm not wrong). And how SetLayerStyle works to move several objects together, I still don't know anyway
regards,
Tom
Okay, I checked 'AddMove()/DoMove()' and it works, but you have to take care about the animation yourself, i.g. speed, the way the objects go from start to destination, etc).As Paul already said, you can use AddMove() for that or with Hollywood 4.0 it is even easier using the SetLayerStyle() command.
So, my feature request is still valid, because it would be simply nice to combine objectes and then do somthing like MoveGroupedLayers() in order to move all grouped objects by a certain amount of pixels in x and/or y direction, relative to each object's position. and with the posibility of FX-effects like: #BOUNCE, etc.
Wit AddMove()/DoMove() you have to take care of everything yourself (if I'm not wrong). And how SetLayerStyle works to move several objects together, I still don't know anyway
regards,
Tom
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[20 Aug 2009] Re: Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Aug 2009 14:53:59 +0200

Finding out if a table item exists is really easy. Just use the RawGet() function. If it returns Nil, then the table item doesn't exist, e.g.
Oh no, never ever do it like thatFor example, if i like to know if a certain "key" is set or has a non-null value, it would be convenient to do the following:
if (table[key] <> nil) Then do_something Else do_something_else
Of course, I could traverse all the content of the table in order to know if "key" is an element in the table, but this takes time and is not that niceIt would look like this:
Finding out if a table item exists is really easy. Just use the RawGet() function. If it returns Nil, then the table item doesn't exist, e.g.
Code: Select all
t = {x = 5, y = 6}
Print(RawGet(t, "x")) --> 5
Print(RawGet(t, "y")) --> 6
Print(RawGet(t, "z")) --> Nil
Nope, you can change the style of as many layers as you wish.Ah, yes. AddMove()/DoMove() most likely does the job
But how does SetLayerStyle() work? I don't really get how it works (from the documentation). Let's say, I want to move 2 Layers from its current position 10 px to the left (relative to each object's x position) and the movement should work in the way like "MoveLayer()" it does: that is, the movement should be visible and not a jump from one position to the next.
SetLayerStyle() takes as arguments the ID from only one layer, right?
Just use a loop:And with X,Y I can specify it's new position on the screen, right?
But how can I combine the movement of 2 objects then? And how can I control the movement itself (e.g. the speed)?
Code: Select all
; move 5 pixels per cycle
speed = 5
; move layers 1 & 2 from 0 to 640 at a variable speed
For Local k = 0 To 640 Step speed
SetLayerStyle(1, {x = k}, 2, {x = k})
VWait
Next
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[20 Aug 2009] Re: Re: Feature Request: eval(), etc.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 20 Aug 2009 14:54:47 +0200

Yes, layer grouping is of course planned since a long time. But it is quite some complex stuff so I haven't tackled it yetOkay, I checked 'AddMove()/DoMove()' and it works, but you have to take care about the animation yourself, i.g. speed, the way the objects go from start to destination, etc).
So, my feature request is still valid, because it would be simply nice to combine objectes and then do somthing like MoveGroupedLayers() in order to move all grouped objects by a certain amount of pixels in x and/or y direction, relative to each object's position. and with the posibility of FX-effects like: #BOUNCE, etc.![]()