Hi, I have been looking to find a way to run a command once and then split the output and use it in two locations.
I was hoping that RegExpSubstitute and Substitute would work on two string meters that use the same measure, but the substitute only seems to work on the measure.
This is an example where measureTime returns two times separated by | as in 13:50|88:34:10. I would like to run the measure once and use the output in two meters, but the substitute seems to be ignored.
Last edited by balala on February 11th, 2020, 6:16 pm, edited 1 time in total.
Reason:Please use <code> tags whenever are you posting code snippets. It's the </> button.
Substitution only works on measures, that's why it's in the General Options in measures (duh)
You can just make 2 measures which you substitute and then MeasureName them on the meter, though we're missing other info, what does the RunCommand measure/plugin even do in your example? What do the measureTimes even do? Not enough info to help
Thanks for your quick response. I was just trying to avoid running the #RMTMR# twice. It is a custom app that returns two timers from two different sources.
Unless two measures can use the single measure a source...It's not really a calc I need which looks like it could handle it with numbers, its more for string handling as I may want to add some other information to the output of the app.
The other option would be to output to a file and then use a Webparser to a local file. Just trying to keep it simple..ish, so I may take that route.
Last edited by balala on February 11th, 2020, 6:16 pm, edited 1 time in total.
Reason:Please use <code> tags whenever are you posting code snippets. It's the </> button.
It is extremely hard for anyone to offer help, if you don't help us to help you. For instance:
JohnE wrote: ↑February 11th, 2020, 5:21 pm
This is an example where measureTime returns two times separated by | as in 13:50|88:34:10. I would like to run the measure once and use the output in two meters, but the substitute seems to be ignored.
Which "this"? Where is the measure in cause?
Another one:
JohnE wrote: ↑February 11th, 2020, 6:01 pm
I was just trying to avoid running the #RMTMR# twice. It is a custom app that returns two timers from two different sources.
What exactly #RMTMR# is? Who can tell what it does, if we don't even know what that program is. Even better would be to have the program, but at least to know its name would be essencial.
So, first please pack the whole config you have and upload the package (include the program, as much as possible). This way we could replicate the results.
Balala, it is my own code that just outputs some delimited text, the variable #RMTMR# is in an include file pointing to the exe. It doesn't really matter what it returns, I just was trying to get a way to have delimited output to the RunCommand Plugin that I could run once and be able to split the output into two meters. At the moment the exe runs twice for two separate outputs which is not efficient.
JohnE wrote: ↑February 11th, 2020, 10:30 pm
At the moment the exe runs twice for two separate outputs which is not efficient.
Jeff's approach can work, but a more brute force way to tackle it is with another set of measures. You still need the original RunCommand measure, but then add a String measure to grab the leading string from the RunCommand result, and another to grab the trailing string. Just a thought... String measures are pretty lightweight, but not as light as none at all.
I am soooooooooo god damn dumb
On the string measure I read the note as Any combination of hard-coded text, variables, dynamic variables, or section variables are not evaluated in this option. instead of what is actually on the page and that's why I didn't recommend string measures at first.
Add
somewhere in the code (preferably after that measure) and you just MeasureName them on the time meter strings respectively
(you can get rid of DynamicVariables and do FinishAction=!UpdateMeasures if you want, up to you)
Sorry for my lack of being able to read
Last edited by Jeff on February 12th, 2020, 12:03 am, edited 1 time in total.
There are many ways to be different - there is only one way to be yourself - be amazing at it
The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.