Hi

Here is my problem, I have a asynchron function (MyAsynchronFun), I need it
many time in my code, but problem is that I need its output to continue my
script, here is sample

a = 1;

MyAsynchronFun( function(a) {

  b = some_return_value_from_MyAsynchronFun;
  ...
  MyAsynchronFun( function(b) {
  ...
  c = some_return_value_from_MyAsynchronFun;
  ...

  })

})

Whereas I need to call this function several times so it make code so
complex,

Here is what I need

a = 1;

b = MySynchronFun( a );
....
c = MySynchronFun( b );

so I want to convert a asynchron function to synchron one, here is my idea


MySynchronFun (a) {

  MyAsynchronFun( function(a) {  .... , cancel_pause()             } );

  PAUSE();

  return  some_return_value_from_MyAsynchronFun;

}


There isn't any real pause function for JS, but I wonder if there is
something like alert() which make script stop without any cpu usage and
cancel_pause should be something like clicking on OK in alert window

so is there any idea about this kind of pause function ?
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners

Reply via email to