It is currently March 29th, 2024, 10:51 am

Using [!WriteKeyValue] to change a RegExp stored in a variable doesn't seem to work

Get help with creating, editing & fixing problems with skins
User avatar
imaquietkid
Posts: 5
Joined: February 13th, 2020, 3:54 pm

Re: Using [!WriteKeyValue] to change a RegExp stored in a variable doesn't seem to work

Post by imaquietkid »

jsmorley wrote: June 12th, 2020, 6:22 pm Yes, everything between """Magic Quotes""" is treated as a literal, and no evaluation of section variables, variables, character variables, formulas, or any of that is attempted.

RegExp in particular can be run through with all kinds of weird characters. It's not a bad idea to force that as entirely literal when passing it as a string to a bang like !WriteKeyValue that will evaluate and resolve variables in it.
I had completely forgotten that feature, thank you so much ! I'll mark the post as solved !
balala wrote: June 12th, 2020, 6:16 pm So finally based on jsmorley's above reply, here is the solution: instead of the [!WriteKeyValue Variables News#CurrntSkinIndex#RegExp "#RegExpJT#" "#@#UserSettings.inc"] bang, use [!WriteKeyValue Variables News#CurrntSkinIndex#RegExp """#RegExpJT#""" "#@#UserSettings.inc"].
Take care, I'm not the author of this solution, it definitely belongs to jsmorley.
Still thank you so much for the help
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using [!WriteKeyValue] to change a RegExp stored in a variable doesn't seem to work

Post by balala »

imaquietkid wrote: June 12th, 2020, 7:07 pm Still thank you so much for the help
Although I should have to know, I didn't realize what's going on. My bad...