if Length<=Width and Mode=2 then
Int = 0
else
Int = 1
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 . . .
It isn't the "and" that is giving you trouble here, it is the fact that you are using an assignment operator "=" when you mean to use a comparison operator "==" in "Mode=2".
Also... Didn't know I could do it that way. I thought that in lua they evaluate to true or false.
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 . . .
Right. Lua "shorthand" stuff is very cool, but to be honest I'm glad it also works in a more "basic" syntax structure to initially be a bit more accessible for new users. Lets someone who isn't a programmer wrap their head around it a bit quicker. I do suggest that anyone who wants to really get better at this Lua stuff take a look at the "shortcuts" that Lua has. They are clever indeed. They can reduce code, and although in the little scripts we are writing for Rainmeter a few cycles either way is not going to generally make any difference, they can be more efficient.
Could you please explain the shorthand a bit, I haven't gotten that far into my understanding yet. I'm a basic scripter as most of my experience lies with writing basic for my TI-89 back in high school.
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 . . .
smurfier wrote:Could you please explain the shorthand a bit, I haven't gotten that far into my understanding yet. I'm a basic scripter as most of my experience lies with writing basic for my TI-89 back in high school.
I'm no expert, I'm just starting to wrap my head around a lot of it myself, but this page has some good info on how "expressions" can be efficiently written.
I understand your PM, I just wanted to hide my "duh" moment behind closed doors.
I just need to understand that particular like of shorthand because I feel really bad "publishing" a line of code that I don't understand. Also, I've been reading the tutorial, I'm just one that needs to learn things the hard way.
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 . . .