Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Actions, Macros, and Parameters
#1
I've written a macro to Titlecase an input string. The macro runs fine in the IDE, but appears to do nothing, or is skipped in the Action. Is there a way to debug (step through) Actions, BTW?

Here is my calling convention:
Code:
Devices::FieldWrite(Denon-2807-Den.FXWrite, Stereo)
Devices::WaitFieldValue(Denon-2807-Den.FXRead, STEREO, Equal, 5000)
LocalVars::SetVariable(LVar:TmpStr, $(Denon-2807-Den.FXRead))
LocalVars::SetVariable(LVar:AudioMode, "Unset")
MacroEng::RunMacro(MEng.User.CMLBin.ToFirstCaps, %(LVar:TmpStr)  LVar:AudioMode)
TBarAudioBkgrd::SetText(Audio Mode - %(LVar:AudioMode))
LocalVars::DeleteVariable(TmpStr)
LocalVars::DeleteVariable(AudioMode)

Here is my macro entry point (all the code is in the Start() method):
Code:
Method Start([In] String InString, [Out] String OutString) Returns Int4

The "AudioMode" variable is initialized to "Unset" and is still that value after the macro. Have I got my macro parameters specified correctly? (There is a space between the two parameters).
Jim
Reply
#2
You cannot get any information back out of macro to an action at this time. That's why it doesn't appear to do anything. So output parameters are just ignored by the action system when it invokes the macro.

This is because previously there wasn't really anywhere to put the output. It wasn't until 2.0 that there was any place you could have put any output from them. And with all the work required for 2.0, I just didn't have the time to add support for this, though I agree that it's quite desirable to have now.

It would take a fair amount of checking and double checking to look at the Start() method parameters and make sure that they make sense given what you've provided as parameter values for in or out. But it's definitely something that would add a lot of power.

Let me look into this today. Even if I can just get a fairly limited scenario working for the next drop, it would be worth it. And it should be pretty safe to do since no one is using it now and if it turns out to be flakey for some reason, people can just keep not using it until I figure out how to make it unflakey.
Dean Roddey
Explorans limites defectum
Reply
#3
Thanks, Dean. Well, I've got an admittedly simple test all ready to go:-). I'd originally intended just to pass the OutString as the Method's return value, but I couldn't think of a way to do a variable assignment of the return value, and so the syntax I ended up with seemed the most logical in the alternative.
Jim
Reply
#4
Yeh, it would have to be via output parameters. And of course that would allow for multiple values coming out as well.
Dean Roddey
Explorans limites defectum
Reply
#5
Why not use the Var Driver and write/read to that as the interface between the Macro and the Interface?
Reply
#6
It could be done, but it requires a separate set of fields for every touch screen, and just isn't nearly as slick as getting values back out of the macro.
Dean Roddey
Explorans limites defectum
Reply
#7
I've dealt with this. See the official 2.0 thread in the beta section...
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CML Macros - Replacing Quotes gReatAutomation 2 264 02-13-2021, 11:59 AM
Last Post: Dean Roddey
  Escaping Character in Action Parameters gReatAutomation 0 333 09-02-2020, 05:51 AM
Last Post: gReatAutomation
  HTTP Trigger and Parameters znelbok 1 531 06-11-2020, 03:41 PM
Last Post: Dean Roddey
  I cant enter parameters for sizing into the webcam widget. I get errors about invalid ghurty 2 691 04-29-2020, 04:01 PM
Last Post: Dean Roddey
  Pause / Resume Triggered or Scheduled Actions from the Interface Viewer gReatAutomation 2 1,355 10-30-2019, 01:38 PM
Last Post: gReatAutomation
  Some workarounds to copy/paste Actions RichardU 3 1,809 01-19-2018, 09:34 AM
Last Post: Dean Roddey
  Regular Expersions in Actions znelbok 1 1,339 12-26-2017, 05:48 PM
Last Post: Dean Roddey
  Saving Global Actions RichardU 1 1,274 12-20-2017, 11:18 AM
Last Post: Dean Roddey
  String list in actions znelbok 3 2,239 11-06-2017, 04:10 PM
Last Post: Dean Roddey
  Problem with Action Parameters pjgregory 8 4,424 06-29-2017, 03:45 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)