Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 11, 2016, 12:11:25 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: FARR.setInterval(id, millisecond, pFunc);  (Read 3998 times)

czb

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 336
    • View Profile
    • My open-source online piano game
    • Donate to Member
FARR.setInterval(id, millisecond, pFunc);
« on: April 21, 2008, 05:08:31 AM »
Hi,
does it work inside javascript? I have tried it, but pFunc was allways called immediately.
My open-source online piano game: https://github.com/musicope/game

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR.setInterval(id, millisecond, pFunc);
« Reply #1 on: April 21, 2008, 05:11:21 AM »
what is setinterval?

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: FARR.setInterval(id, millisecond, pFunc);
« Reply #2 on: April 21, 2008, 05:16:53 AM »
Javascript timers
This is not related to FARR itself but to the writing plugins with javascript bit.

czb

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 336
    • View Profile
    • My open-source online piano game
    • Donate to Member
Re: FARR.setInterval(id, millisecond, pFunc);
« Reply #3 on: April 21, 2008, 05:48:59 AM »
justice: I see... and does it work for you?
My open-source online piano game: https://github.com/musicope/game

czb

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 336
    • View Profile
    • My open-source online piano game
    • Donate to Member
Re: FARR.setInterval(id, millisecond, pFunc);
« Reply #4 on: April 21, 2008, 06:34:07 AM »
I have tried following code and I get variance of type error (tranlated from czech) with setInterval and then I also get that FARR.killInterval(id); is not supported by object... any idea what to do with it?
Code: Javascript [Select]
  1. // plugin script :
  2. displayname="FScript";
  3. versionstring="1.0.0";
  4. releasedatestring="Jan 1st, 2008";
  5. author="Author";
  6. updateurl="";
  7. homepageurl="";
  8. shortdescription="FScript";
  9. longdescription="FScript";
  10. advconfigstring="FScript";
  11. readmestring="FScript";
  12. iconfilename="FScript.ico";
  13.  
  14. aliasstr="aa";
  15. regexstr="";
  16. regexfilterstr="";
  17. keywordstr="";
  18. scorestr="300";
  19.  
  20. // type
  21. UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
  22. // Postprocessing
  23. IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
  24. // search state
  25. STOPPED=0; SEARCHING=1;
  26.  
  27. function test(){
  28.   FARR.debug("test");
  29. }
  30.  
  31. function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  32.         if(!explicit) {
  33.                 return;
  34.         }
  35.   FARR.setInterval(1, 5000, test());
  36.   FARR.killInterval(1);
  37. }
My open-source online piano game: https://github.com/musicope/game

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 409
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FARR.setInterval(id, millisecond, pFunc);
« Reply #5 on: April 24, 2008, 01:41:06 PM »
Hello czechboy and other happy JScript developers. The JScript SDK bug on setInterval and killInterval is fixed. In fact as nobody, included myself was using it, it had been humm... removed. Get the last JScript SDK at :

http://e.craft.free.fr/farr/FScript/

The fix is included in the version 1.3
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,845
    • View Profile
    • Donate to Member
Re: FARR.setInterval(id, millisecond, pFunc);
« Reply #6 on: March 18, 2010, 03:40:17 AM »
I hope this topic is appropriate :)

I'd like to be able to use the return value of a Date object's getTime method for the id of setInterval.  I think currently it may cause an overflow -- at least that's the sort of message I'm getting via Script Debugger.

Would this be an easy / worthwhile change to setInterval in fscript.dll?

I'm currently using version 1.20 -- at least that's what the file's properties indicate.

Thanks for the consideration -- and below is a quote from MDC's documentation on Date objects:

Quote
getTime
    Returns the numeric value of the specified date as the number of milliseconds since January 1, 1970, 00:00:00 UTC (negative for prior times).