Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global variables gets shared between two lua scripts #905

Closed
LinuxOnTheDesktop opened this issue Nov 17, 2019 · 2 comments
Closed

Global variables gets shared between two lua scripts #905

LinuxOnTheDesktop opened this issue Nov 17, 2019 · 2 comments
Labels

Comments

@LinuxOnTheDesktop
Copy link

@LinuxOnTheDesktop LinuxOnTheDesktop commented Nov 17, 2019

Issue

I run two lua scripts from conky. Each has a global variable called debug. Each does something if debug is not zero. If I set debug to 1 in one of the scripts, then the other script acts as if its version of the variable had been changed. Is this a known limitation?

Information

conky 1.11.4_pre. (I would use a more recent version, were I not to encounter bug #821.)

@lasers

This comment has been minimized.

Copy link
Collaborator

@lasers lasers commented Nov 17, 2019

Internet tells me it is a typical lua behavior because of global variables. Look this up and modify your scripts to add local to everything so you don't accidentally assign wrong overwrite anything.

@lasers lasers added the question label Nov 17, 2019
@LinuxOnTheDesktop

This comment has been minimized.

Copy link
Author

@LinuxOnTheDesktop LinuxOnTheDesktop commented Nov 17, 2019

Understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.