-
-
Notifications
You must be signed in to change notification settings - Fork 19
OSL ‐ this and local data
DanimalsTCGYT edited this page Aug 4, 2024
·
3 revisions
In osl all variables are global scope and to use locally scoped variables you must use the keyword this
You can use this
inside of the following scopes
def
method
main
run
The this
variable is a json object that can be modified by setting keys on it, as shown below
this.key = "1234"
log this
// returns {"key":"1234"}
this
has a different value depending on the scope of when you access it
def "test_cmd"
this.hello = "greetings!"
log this.hello
// logs "greetings!"
endef
this.hello = "hello world"
test_cmd
log this.hello
// logs "hello world"
originOS is a web desktop gui with a self contained file system, programming languages, internet system and a whole lot of stuff an os should be able to do Use originOS here