fvisagie
27th June 2014, 17:03
Hi All,
What is the simplest way of creating indented multi-level block statements, when most levels have quoted strings and the block statements aren't easily moved to a function? Although the example below is from runtime script, I also come across this scenario in other cases.
For example, to this script
ScriptClip(c, """
global MF_activeclips = MF_activeclips + 1
global sequence = sequence + "b" + String(MF_activeclips)
INFO = """" + Eval("MF_source" + String(MF_registeredclips)) + """" + " " + \
String(current_frame) + "=" + MF_Frames2INFO(current_frame + Int(Value("""" + tcoffsetstr + """")), Value("""" + String(fps) + """"))
Eval("global MF_INFO" + String(MF_activeclips) + "=INFO")
MF_show == "Clip" || MF_show == "ClipFast" \
? MF_ShowINFO(INFO) \
: last
""", show=false, after_frame=false)
I need to add another condition level as follows
ScriptClip(c, """
current_frame != MF_clipbefore \
? Eval("
global MF_clipbefore = current_frame
global MF_label = "label"
all_of_the_above
") \
: last
""", show=false, after_frame=false)
However, adding quoted expressions to the Eval() statement as above causes a runtime syntax error, not even to mention quoted expressions in the newly indented level.
Thanks,
Francois
What is the simplest way of creating indented multi-level block statements, when most levels have quoted strings and the block statements aren't easily moved to a function? Although the example below is from runtime script, I also come across this scenario in other cases.
For example, to this script
ScriptClip(c, """
global MF_activeclips = MF_activeclips + 1
global sequence = sequence + "b" + String(MF_activeclips)
INFO = """" + Eval("MF_source" + String(MF_registeredclips)) + """" + " " + \
String(current_frame) + "=" + MF_Frames2INFO(current_frame + Int(Value("""" + tcoffsetstr + """")), Value("""" + String(fps) + """"))
Eval("global MF_INFO" + String(MF_activeclips) + "=INFO")
MF_show == "Clip" || MF_show == "ClipFast" \
? MF_ShowINFO(INFO) \
: last
""", show=false, after_frame=false)
I need to add another condition level as follows
ScriptClip(c, """
current_frame != MF_clipbefore \
? Eval("
global MF_clipbefore = current_frame
global MF_label = "label"
all_of_the_above
") \
: last
""", show=false, after_frame=false)
However, adding quoted expressions to the Eval() statement as above causes a runtime syntax error, not even to mention quoted expressions in the newly indented level.
Thanks,
Francois