It is currently July 10th, 2020, 6:14 am

Substitute is not working. The "0" still shows up. [solved]

Help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 856
Joined: May 7th, 2016, 7:32 am

Substitute is not working. The "0" still shows up. [solved]

Post by Mor3bane »

For some reason this Substitute is not working. The "0" still shows up.

This is with the AIMP player.

Not sure is a space is in there or what?

Code: Select all

[TrackNum]
Measure=NowPlaying
PlayerName=#PlayerName#
PlayerType=Number
Substitute="^0$":"Num"
Last edited by Mor3bane on May 25th, 2020, 7:29 am, edited 1 time in total.
My DevArt Gallery

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 is requires luck to achieve.
dvo
Posts: 818
Joined: February 7th, 2016, 6:08 am

Re: Substitute is not working. The "0" still shows up.

Post by dvo »

did you try :

Code: Select all

Substitute="0":"Num"
mak_kawa
Posts: 720
Joined: December 30th, 2015, 9:47 am

Re: Substitute is not working. The "0" still shows up.

Post by mak_kawa »

Hi Mor3bane

Are you missing RegExpSubstitute=1?
User avatar
Mor3bane
Posts: 856
Joined: May 7th, 2016, 7:32 am

Re: Substitute is not working. The "0" still shows up.

Post by Mor3bane »

dvo wrote:
May 25th, 2020, 6:32 am
did you try :

Code: Select all

Substitute="0":"Num"
Yes, but then every appearance of 0 says Num then so "10" would be "1Num"

Thats why is went with string start "^" and end "$".
My DevArt Gallery

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 is requires luck to achieve.
User avatar
Mor3bane
Posts: 856
Joined: May 7th, 2016, 7:32 am

Re: Substitute is not working. The "0" still shows up.

Post by Mor3bane »

mak_kawa wrote:
May 25th, 2020, 7:23 am
Hi Mor3bane

Are you missing RegExpSubstitute=1?
Just missed ya mak kawa.

That seems to be the fix right there!

Thanks (again) :thumbup:
My DevArt Gallery

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 is requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Substitute is not working. The "0" still shows up. [solved]

Post by balala »

Let's clarify a few things. In the Substitute="^0$":"Num" option, ^0$ means 0 and nothing else. ^ means the beginning of the expression, while $ means its end. So with this substitution, 0 is substituted only if there is nothing else but a 0. If either before the 0, or after it there are other characters as well, the substitution doesn't happen.
Using such regular expression substitutions, requires to add a RegExpSubstitute=1 option to the measure, as well, because the default value of the RegExpSubstitute option is 0.
If you add a simple Substitute="0":"Num", all occurrences of 0 will be substituted with Num, so for instance 100 will be substituted with 1NumNum.