It works.
But you also need to combine their results in the same way to replace them with text messages using Substitute
for example mInPhase is "r" and mPhase is "100"
Then the image r100.png is displayed
And we need to somehow get the value of r100 to replace it with the text “full moon”
It works.
But you also need to combine their results in the same way to replace them with text messages using Substitute
for example mInPhase is "r" and mPhase is "100"
Then the image r100.png is displayed
And we need to somehow get the value of r100 to replace it with the text “full moon”
There is no clear question in your post, so not sure anyone would know what you mean. So, I'll be the one to ask instead:
- do you want "r100.png", or "full moon.png" as your image?
- if the former, do you want "full moon" as some text displayed elsewhere?
Basically, I'm trying to find out if you want image "r100.png" and text "full moon", or both image "full moon.png" and text "full moon". Either way, you already answered your own (missing) question, using Substitute in the relevant measures (not meters) is the way to go.
Kotofanchik wrote: ↑March 20th, 2024, 8:05 pm
I have two measures. One results in the letter r or s (increasing or decreasing), and the second results in the numbers: 0, 10, 25, 50, and so on.
I assume the numbers are the percent of the moon being illuminated, right? If so, then, that's simple: create another String measure concatenating the strings from the measures providing the r/s and the 0/10/.../100, then add a Substitute to the new measure to "convert" its value to the "full moon" text and similar. Finally, for displaying the "full moon" and such texts, create another String meter referencing the newly created measure and you're done.
Yes, that's what I need. I couldn't combine into Measure. I tried a little at random, not understanding how to put parentheses there and what to write, but it didn’t work for me. Everything is fine now Thank you
Kotofanchik wrote: ↑March 20th, 2024, 11:36 pm
Yes, that's what I need. I couldn't combine into Measure. I tried a little at random, not understanding how to put parentheses there and what to write, but it didn’t work for me. Everything is fine now Thank you
Excellent - you're welcome!
By the way, forgot to mention, ^ means beginning of the string, and $ means the end of the string in regex. This is in order to replace only the said string, and not simply a string containing it. For example, if you don't use this and you have "r10":"blah","r100":"blahblah" then "r100" will never be properly replaced and will end up as "blah0", given that "r10" will be replaced first since "r100" contains "r10".
Yes, I don’t know these tricks, but I copied them just in case. It turns out not in vain. Otherwise, I would be racking my brains as to why the replacement didn’t work correctly.
Kotofanchik wrote: ↑March 21st, 2024, 5:09 am
Yes, I don’t know these tricks, but I copied them just in case. It turns out not in vain. Otherwise, I would be racking my brains as to why the replacement didn’t work correctly.