Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
envoking functions that will run independantly of calling ma
#1
Hello, I would like to know if it is possible to envoice a function from a macro, which spawns another process running that function so that control immediately returns back to the macro, regardless of the state of the function. Simplistically I have a code piece as an example:

myfun is a function that has this in it

Code:
Copy      Help
int t
for t 1 100000
,out "The function is running - %d" t
,wait 1


then the macro would be

Code:
Copy      Help
myfun
rep 100
,out "Testing call to function"


In this example you should see the following in the output window (note that the print order is not significant, just trying to give an idea):

The function is running - 1
The function is running - 2
Testing call to function
The function is running - 3
Testing call to function
Testing call to function
Testing call to function
Testing call to function
The function is running - 4
......
The function is running - 100000

The main jist is that the macro and functions are now running independantly.

Can this be done, and if so, how?

Thank you for your advice.

-kam
#2
Instead of

myfun

, which calls the function, use

mac "myfun"

, which launches myfun in new thread.
#3
Gintaras Wrote:Instead of

myfun

, which calls the function, use

mac "myfun"

, which launches myfun in new thread.

Thank you, that was perfect!

-kam
#4
Hi,

i have written two independent function. i would like to call each of the functions one after the ather.. how can i call..?

Eg: function names are
1) OpenApplication
2) CloseApplication

this is how i tried to call the function
mac OpenApplication
mac CloseApplication

when i executed this the first function executes but not the second function

Can anyone in the forum help me regarding this..

Thanks,
Nithin
#5
Don't use mac.

OpenApplication
CloseApplication

If you need to use mac, enclose function name into quotes.


Forum Jump:


Users browsing this thread: 1 Guest(s)