[SOLVED more or less] Wildcard in numbers

Is there a way to add wildcard in numbers?

Like imagine i have timer running
Now i want something happen each time last digit of seconds is 5

So for example if seconds part is 05 or 15 or 25 or 35 and so go on
I trigger something

But instead of writing every possible combination via events do it via one Condition like
If timer is equal to [#]5
Action
Do something

Where [#] would be wildcard indicating there can be any number there

You could use mod(#, #) it returns the remainder of the first number divided by the 2nd. For a floating number you’d need to make it a whole number first.

Something like
Compare 2 numbers
mod(trunc(elapsed time), 5) = 0

(modulo and truncation)

That is what i am doing
Even so it kinda do fix the issue
It is not answer to my question

I was hoping for some symbol/expression that would work as wildcard if there is anything like it

You could convert it to text and compare it as a string. There’s a regular expression extension. It does it through Javascript

I understand i would go with ToString(Time(sec))
But what to do next?

I just realized it would be the same as what i am doing right now
BTW correct expression is mod(trunc(Time(“sec”)), 10)
Not 5
It needs to be 10
If it is 5 it goes from 0 to 4 never reaching 5
It would need to be 6 to reach 5 but then it would happen each 5 seconds
NOT each time 5 is at the end of seconds
Since if it is mod(trunc(Time(“sec”)), 6) it would go from 0 to 5 and then reset to 0

I’ve never used the extension. It seems powerful. For the last digit, you would need to remove the decimal then you could do things like check a character with one of the text manipulation functions. The conditions that use text now have a starts with and ends with otherwise you can use compare 2 strings.

Yeah so it would be same thing as doing it via mod and trunc

OK thx Keith i think i gonna stick with what i have

1 Like