TimerFcn in functions



Hi,

I am trying to use a TimerFcn from within a function. The function does not
require or return any values, so it could also be run as a script, but for
performance reasons I think I need it to be a function file.

If I run the file as a standard script file, the timer works as expected.
But when I turn the script file into the function that it should be, the
timer cannot be run.

The timer is supposed to update a wait bar every two seconds in relation to
the amount of data (ftell position inside the data file to be evaluated by
the script/function) processed by the script/function.

t=timer('TimerFcn','waitbar...' etc.)

The timer needs an fid for displaying the wait bar, the filelength of the
datfile and the ftell-position of the file.

The error says that fid is an unknown function/variable.

I have tried to set the fid to global or persistant, but this did not help.

What can I do to make the timer run?

Regards,
Crypto.
.



Relevant Pages

  • Re: Yes
    ... You set the timer interval, ... The conventional way of doing this would be to write a wscript class, and then give a reference of the class to the script control. ... Public Property Let Parent ... Public Property Get CreateObject(vProgID As Variant, Optional vPrefix As Variant = "") As Object ...
    (microsoft.public.scripting.wsh)
  • Re: Restarting Pcs
    ... The script called "wait.ipf" works ... fine though timer is visible. ... "Terry M" escribió en el mensaje ... I thought you just wanted it to restart after 5 min. with no ...
    (microsoft.public.sms.installer)
  • Displaying Ajax data and using timers properly
    ... I'm trying to modify an example Ajax script to fit my needs. ... there is a setInterval timer used that periodically goes to ... of the setInterval restart. ...
    (comp.lang.javascript)
  • Re: TimerFcn in functions
    ... Put fid in the userdata of the timer object when you create it. ... timerObj = timer ... If I run the file as a standard script file, the timer works as expected. ...
    (comp.soft-sys.matlab)
  • Re: kernel timer frequency
    ... ...subtract first number from second, get timer Hz (+ a few Hz, ... automatically alter grub.conf to reflect the new kernel's presence? ... What does "make install" do? ... This script may or may not do the right thing. ...
    (comp.os.linux.misc)