Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using mac as a function - returning variables
#1
I like to use
Code:
Copy      Help
mac "Function"
when I can so the function will run asynchronously (in a separate thread) which speeds things up. But when I need a variable returned, I call the function as a function (i.e. without
Quote:mac "..."
.

But I am aware that mac can be used as a function but when I try it, my return variables get messed up:
I know that you have to put in an extra "" for command variable:
Quote:Something to be stored into the _command variable.

Macro MacFunctionTest
Code:
Copy      Help
str Test =  "ooo"
mac "UpperCaseFunc" "" Test
out Test

Function UpperCaseFunc
Code:
Copy      Help
function str&Test
Test.ucase

When I run this I get the following RT error:

Quote:Error (RT) in UpperCaseFunc: invalid pointer. ?

I am not sure if I should be putting the & in front of string references, using lpstr or what?
Any ideas?

Also if in a function I call several other functions as mac, will they not each run in a separate thread (several at a time) or only one at a time?

Code:
Copy      Help
mac "Func1"
mac "Func2"
mac "Func3"
mac "Func4"

The reason I ask is I see this in help menu under "mac":
Quote:Two macros cannot run simultaneously. If both items (this thread and macro) are macros (not functions, etc), macro starts when this thread ends. If only macro is macro, is applied "If a macro is running" property.
S

Thanks,
S


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)