-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Globals in For Loops ( or other "blocks" ) #629
Comments
GWRon
changed the title
Globals in For Loops are not global
Globals in For Loops ( or other "blocks" )
Jul 13, 2023
I am not sure if BCC should error out if someone "defines" a global somewhere where others cannot reach it. Or maybe "warn" ? |
Midimaster ammended that a global in a "block" exists for the whole lifetime of the block (eg loop)
Maybe the documentation for "global" should reflect it ? |
Maybe a better way to put it would be...
"A global within a scoped block, and its assigned/updated value, will exist
for the lifetime of the application, but it is only available to be used
within the defined scope and any inner scopes from where the global is
defined."
Something like that 😬
…On Thu, 13 Jul 2023, 19:29 Ronny Otto, ***@***.***> wrote:
Midimaster ammended that a global in a "block" exists for the whole
lifetime of the block (eg loop)
For Local i:Int=0 To 9
Global wert:Int=10
wert=wert+1
Print wert
Next
Maybe the documentation for "global" should reflect it ?
—
Reply to this email directly, view it on GitHub
<#629 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADYSTENOD2WNOOLG24BBX63XP7L2BANCNFSM6AAAAAA2IYOPFQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a user had an issue reported in discord. I extracted the original problem:
I thought a global can be declared everywhere - but it seems it can't:
Output:
Same also for While-loops and surely other "blocks". And also inside "if endif".
The text was updated successfully, but these errors were encountered: