PDA

View Full Version : Return Last


Delta2
4th November 2008, 21:07
I wish to ask if I'm correct in my interpretation of "return last" command

I assume it will resume execution of the script to the last successfully command, is that correct ?

for example, this script :

AVISource("video.avi")
converttoyv12()
try{
any_bad_command
}
catch (err) {
return last
}

after the bad command it will resume to "converttoyv12" line

is that correct ?

neuron2
4th November 2008, 22:21
It will return the clip referenced by the implicit clip variable "last". That will be the result of the last command that successfully assigned a clip to "last". If a command does not explicitly assign the result to a variable, it is assigned to "last". E.g.:

avisource("file.avi") # assigns to last
vid=tweak() # assigns to vid

Here "last" holds a reference to the untweaked source, while "vid" holds a reference to the tweaked source. Note that no input clip is specified for Tweak(), so it uses the implicit clip "last".