PDA

View Full Version : A keystroke to stop my Lscript



eben
02-10-2010, 09:25 AM
hi,

Do you know a way to inset a sort of keystroke-listener or something like that to interrupt a Lscript execution ?
I've got a very big file to parse, and for the moment i must go to taskmanager to kill modeler process. I don't like that...

regards

Matt
02-10-2010, 10:56 AM
You could try using the moninit / monstep / monend commands:


// Start progress monitor
moninit( variable_containing_max_amount, "Parsing file ...");

// Loop until we reach the number of copies requested
for(LOOP = 1;LOOP < variable_containing_max_amount; ++LOOP)
{

// Do parsing stuff

// Step progress monitor, break loop if ESC key or Cancel button is pressed
if(monstep())
{
info("Aborted");
break;
}
}

// Close monitor and free resources associated with it
monend();

eben
02-10-2010, 11:53 AM
ah! thanks! i didn't know the monxxx commands can do that

walfridson
07-26-2010, 04:19 AM
Anyone got this to work in Layout?
It's crashing for me all the time on moninit(layout crashes...)
Tried just setting like moninit(10) but no luck.


Using The Monitor

Unique among Layout LScript plug-ins, LS/IF provides access to a progress monitor, quite similar to that offered by Modeler LScript. Because a great deal of processing can take place inside an Image Filter plug-in (imagine having to perform some function on each pixel of a 640x480 image for each frame of animation!), a visual indicator is used to provide feedback to the viewer concerning the progress of processing.

The following functions are used to manage Layout-provided monitor access. As you will see, usage of these functions is almost identical to those provided within Modeler LScript.

moninit(steps)
initializes the monitor system, indicating the anticipated
number of steps required to complete the processing task
monstep([advance])
advances the monitor indicator by the optional integer value
provided. if no argument is provided, then the advance value
is 1
monend()
terminates the monitor system