Se Connecter:     


Forum: General Discussion

Sujet: Script School - Page: 52
Example of the deepest you can go with ` " '


set result 0 & set a 1 & set b 2 & set c 4 & set d 8 & set e 16 & set f 32 & set g 64 & set h 128 & param_add `param_add "param_add 'get_var a' 'get_var b'" "param_add 'get_var c' 'get_var d'"` `param_add "param_add 'get_var e' 'get_var f'" "param_add 'get_var g' 'get_var h'"` & param_cast & set result & var_list


So the first bit is just setting some variables, no need to explain
then we say param_add and our param is a script action so we open a ` then our script action is param_add again and the param for that is a script action so we open a " then our script action is param_add again and it's params are also a script action so we open a '
this 3rd level of param_add, the ' is open the first param is get_var a, so then we close the ' , we're onto the 2nd param for the 3rd param_add so we open another ' get_var b the close the '
that completes the 1st param for the 2nd param add so we close the "
we're now onto the 2nd param of the 2nd param_add so we open another " and so on.

This is a pretty dumb example but this is as deep into script inception you can go.
And I have gone that deep in some cases.

One thing I dislike is spaces in fx names, the fx name needs to be wrapped in ' or " and that means I can go 3 levels deep with echo but I can't go as deep with "mt delay"
that's why all my fx I've created never contain a space, sometimes I use camelCase, sometimes I use under_score
that said it's a super rare case that I have to go that deep and I can work my way round it usually, but it would be nice if fx names were under_scored instead of containing spaces.
But script is a language, languages are never 100% consistent.