-
Notifications
You must be signed in to change notification settings - Fork 0
The access operator
Julius Paffrath edited this page Dec 8, 2016
·
2 revisions
Let's say you write a function test:
store 100 in num
function test()
print(num)
end
Now you call the function but, whoops! There is an error! Right, you can't access the variable num because in jask, every function runs in it's own separated scope.
But there's is a trick to achieve that: The access operator "!":
store 100 in num
function test()
print(!num)
end
Now it works! The access operator allows you to access all variables outside your function scope.
- Home
- Getting started
- Control flow
- Functions
- List variables in jask
- Dictionary variables in jask
- Structs in jask
- Convert variables
- Internal Functions
- The access operator
- Callbacks in jask
- Modules
- Internal Modules
- The jask standard library jcore
- Using CMD arguments in jask
- Nested function calls
- Functions inside functions!
- Modules inside functions!
- Performance comparison of loops