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

Variables value changes in condition - bug or intentional? #316

Open
stracker-phil opened this issue Jan 27, 2024 · 1 comment
Open

Variables value changes in condition - bug or intentional? #316

stracker-phil opened this issue Jan 27, 2024 · 1 comment

Comments

@stracker-phil
Copy link

I pass a variable to a snippet. The snippet uses the variable inside a condition, but in side that condition, the variable value is different from outside the condition.

Sample code:

---
title: Condition test
---

<<#SingleWindow
- app_name=Messages

<<#SingleWindow
- app_name=Slack

<<#SingleWindow
- app_name=Mail

___
---[SingleWindow]

(log Start: ${app_name})
	
if app_name

	(log Processing: ${app_name})
	${app_name}
	- XX

	@${app_name}

	(pause 1)
	
end

(log Done: ${app_name})

Log-output in Console:

Start: Messages
Process: Mail  ## Variable changed from "Messages" to "Mail"
Done: Messages

Start: Slack
Process: Mail  ## Variable changed from "Slack" to "Mail"
Done: Slack

Start: Mail
Process: Mail
Done: Mail

As you can see, the log output inside the condition uses the value "Mail" for the app_name variable in all three cases, even though the log message before and after the condition displays the expected value.

Question:
Is this expected? If yes, how can I "persists" a variable value inside a condition?

@ttscoff
Copy link
Owner

ttscoff commented Jan 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants