It is currently April 19th, 2024, 6:19 pm

[solved] How can i use #CRLF# in SKIN:Bang(...)

Discuss the use of Lua in Script measures.
EliteLucker
Posts: 46
Joined: June 29th, 2012, 9:06 am

[solved] How can i use #CRLF# in SKIN:Bang(...)

Post by EliteLucker »

To set an Tootltip dynamical at runtime i use this to set the text

Code: Select all

SKIN:Bang("!WriteKeyValue Variables "..sHolidayPrefix.."Name1 \"New Year\" #RootConfigPath#\DynamicVariable.inc")
But now i want to set an new Line with more Infos

Code: Select all

SKIN:Bang("!WriteKeyValue Variables "..sHolidayPrefix.."Name1 \"New Year#CRLF#Happy New Year\" #RootConfigPath#\DynamicVariable.inc")
This should only be an example, what i got is in DynamicVariable.inc

Code: Select all

HoldidayName1=New Year
Happy New Year
HoldidayName2=
but it should be

Code: Select all

HoldidayName1=New Year#CRLF#Happy New Year
HoldidayName2=
because the newline should be used in the TooltTipText


I thanks for this newbie help :oops:

grr i hate i when i found the answer shortly after i ask in forum grrrgrgggrrgrgrg

Code: Select all

SKIN:Bang("!WriteKeyValue Variables "..sHolidayPrefix.."Name1 \"New Year#*CRLF*#Happy New Year\" #RootConfigPath#\DynamicVariable.inc")

EDIT:

Code: Select all

SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "ToolTipText" "'..tHolidayName[b]..'"')
					SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "ToolTipType" 0')
					SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "ToolTipWidth" 200')	
error: !WriteKeyValue: file not found: <path>New
Last edited by EliteLucker on July 10th, 2012, 6:19 pm, edited 1 time in total.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: How can i use #CRLF# in SKIN:Bang(...)

Post by smurfier »

The issue is that #CRLF# is being expanded into a new line before it's being written. Luckily, there is a fix for that. We simply need to escape the variable using * (#*Variable*#).

SKIN:Bang('!WriteKeyValue','Variables',sHolidayPrefix..'Name1','New Year#*CRLF*#Happy New Year','#RootConfigPath#\DynamicVariable.inc')

Also, note that I converted your bang to the new format used in Rainmeter 2.3.3

SKIN:Bang(Parm1,Parm2,Parm3...)
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
EliteLucker
Posts: 46
Joined: June 29th, 2012, 9:06 am

Re: How can i use #CRLF# in SKIN:Bang(...)

Post by EliteLucker »

Thanks for this info, i will looking to change the whole skin into the new 2.3.3 format. That easier to use for me.