It is currently September 17th, 2021, 1:45 pm

[Fixed] Problem with return in Update

Discuss the use of Lua in Script measures.
User avatar
smurfier
Moderator
Posts: 1930
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

[Fixed] Problem with return in Update

Post by smurfier »

When a variable in Lua is set to "" (ie. Try = "") then set to be returned in Update, the measure instead displays 0.

I just tested this:
PROPERTIES = {}
function Initialize()
Try = ""
end
function Update()
return Try
end
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 . . .
User avatar
jsmorley
Developer
Posts: 22270
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with return in Update

Post by jsmorley »

I guess poiru can weigh in, but "" is NULL which I suspect Rainmeter is treating as "nothing" and thus defaults to "0", which is what any disabled measure returns.
User avatar
smurfier
Moderator
Posts: 1930
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Problem with return in Update

Post by smurfier »

I can add that it worked yesterday.
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 . . .
User avatar
jsmorley
Developer
Posts: 22270
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with return in Update

Post by jsmorley »

Just guessing, but suspect it is due to this:

http://code.google.com/p/rainmeter/source/detail?r=876
poiru
Developer
Posts: 2871
Joined: April 17th, 2009, 12:18 pm

Re: Problem with return in Update

Post by poiru »

Thanks, fixed for next beta.
User avatar
jsmorley
Developer
Posts: 22270
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Problem with return in Update

Post by jsmorley »

Here is a version with the fix Smurfie, in case you need it for progressing with some work you are doing.

http://dl.dropbox.com/u/4991063/Rainmeter/Build/Rainmeter-2.1-r886-beta.exe
User avatar
smurfier
Moderator
Posts: 1930
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Problem with return in Update

Post by smurfier »

Thank You! It was my marquee script that was happening to.
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 . . .